Windows 10: Can you help me with a Task scheduler - excel macro issue?

Discus and support Can you help me with a Task scheduler - excel macro issue? in Windows 10 BSOD Crashes and Debugging to solve the problem; I created a script to open a MS Excel spreadsheet at a fixed time 2:05 pm MT each day and run a macro that copies a field representing the current... Discussion in 'Windows 10 BSOD Crashes and Debugging' started by KenMohnkern, Feb 26, 2021.

  1. Can you help me with a Task scheduler - excel macro issue?


    I created a script to open a MS Excel spreadsheet at a fixed time 2:05 pm MT each day and run a macro that copies a field representing the current daily closing stock value and paste it into the same worksheet at another location allowing me to keep a history of my stock picks.

    The macro works correctly when I execute it from the worksheet by running the macro or using the shortcut cntl-s.

    I created a command that Task Scheduler will initiate daily at 2:05 pm. Using .bat and .vbs scripts to open the MS Excel file and run the macro that will copy a field with the latest stock values for a set of stocks that I am tracking and then past those values into the next set of vacant cells that I designate in the spreadsheet.

    The result is intended to be a daily running record of end of day stock values. I use 2:05 pm because I am in the mountain time zone.

    The problem I am observing is, that when executed by the task scheduler, the data copied into the updated field is the same data as the previous days data and not the current value. This happens only when executed automatically from the Task Scheduler. When I execute that macro from the spreadsheet it records the data correctly.

    Following are the details and the excel file. [COLOR=rgba42, 0, 170, 1]Comment: It appears I am unable to include the example excel file with this as an attachment. I am happy to provide it if I'm informed of how to do it. [/COLOR]



    I appreciate any help you can provide in debugging what I have done so that it runs properly. Currently I am updating it manually by running the macro shortcut Cntl -s.

    Thank you,

    Ken

    The action in Task Scheduler is "

    Can you help me with a Task scheduler - excel macro issue? c8b4b6b8-dbe6-4735-b8c9-643882669f23?upload=true.jpg

    Following are the scripts that I have created:

    Can you help me with a Task scheduler - excel macro issue? a80fda78-d769-45d8-8e01-8a05cc7bd9ea?upload=true.png


    "C:\Users\kenmo\Desktop\stockrecorder.vbs"


    Can you help me with a Task scheduler - excel macro issue? 4f5ba335-078b-41d0-800d-3d5af08f0cf3?upload=true.png



    Using Visual Basic Studio:

    Set xlxsApp=CreateObject"Excel.Application"

    xlxsApp.Visible=true

    Set xlxsworkbook=xlxsApp.Workbooks.Open"E:\My Investments\My Personal Stock Picks with macro1.xlsm"

    xlxsApp.RunStockRecorderDaily

    MS Microsoft Macro:

    Sub StockRecorderDaily
    '
    ' StockRecorderDaily Macro
    '
    ' Keyboard Shortcut: Ctrl+s
    '

    Range"H3:H7".Select
    Selection.Copy
    Range"B20".EndxlToRight.Offset0, 1.Select
    ActiveSheet.Paste
    Range"A1".Select
    End Sub

    :)
     
    KenMohnkern, Feb 26, 2021
    #1

  2. Task Scheduler with error message The selected task »CreateChoiceProcessTask« no longer exists

    Hi,

    Thank you for posting your query on Microsoft Community. Let me assist you.

    I suggest you to clear the task from Task Scheduler using the below steps and check if the issue still persists.

    Steps:-

    • Type Task Scheduler on Search bar.
    • Click on Task Scheduler Library.
    • Select the particular task and right click on it.
    • Select End.

    Hope this information is helpful. Please do let us know if you need further assistance, we’ll be glad to assist you.
     
    Pawan Dhondiyal, Feb 26, 2021
    #2
  3. Task Scheduler does not Run task on schedule

    When I invoke a task with your command line then the Excel macro does what it is supposed to do, provided that

    • I invoke the task under the same account as my current foreground account, and
    • I click the radio button to run the task only when the user is logged on.
    If either of these conditions is not met then Excel hangs in the background, as can be seen by the console command TaskList.exe.
     
    Frederik Long, Feb 26, 2021
    #3
  4. oemSoft Win User

    Can you help me with a Task scheduler - excel macro issue?

    [SOLVED] Schedule Tasks not able to open excel file

    I have changed user's workgroup to be administrator, but when I run schedule task under user account, it only open Excel Application and fail to open file. It does not seem to be right issue, would it be correct?

    Even through I assign schedule task and run under administrator
    account, but it only open Excel Application and fail to open file.

    Do you have any suggestions on what wrong it is?

    Thank you very much for any suggestions (^v^)
     
    oemSoft, Feb 26, 2021
    #4
Thema:

Can you help me with a Task scheduler - excel macro issue?

Loading...
  1. Can you help me with a Task scheduler - excel macro issue? - Similar Threads - help Task scheduler

  2. Help with Task Scheduler

    in Windows 10 Gaming
    Help with Task Scheduler: Hi, I can't seem to find a useful tip to help me resolve my problem. For example, I want to trigger an event start specific program with Task Scheduler only when another program is starting or is started. Suppose I have an application which runs at start upa password manager...
  3. Help with Task Schedule

    in Windows 10 Gaming
    Help with Task Schedule: Hi, I can't seem to find a useful tip to help me resolve my problem. For example, I want to trigger an event start specific program with Task Scheduler only when another program is starting or is started. Suppose I have an application which runs at start upa password manager...
  4. Can you help me with this issue?

    in Windows 10 Gaming
    Can you help me with this issue?: So I tried to connect back to the Ethernet after trying to get a better download speed and it said my IP configuration wasn’t valid and that it won’t connect so after looking through and trying a couple methods online and none worked I restarted my pc and it presented me with...
  5. Can you help me with this issue?

    in Windows 10 Software and Apps
    Can you help me with this issue?: So I tried to connect back to the Ethernet after trying to get a better download speed and it said my IP configuration wasn’t valid and that it won’t connect so after looking through and trying a couple methods online and none worked I restarted my pc and it presented me with...
  6. Can you help me with this issue?

    in Windows 10 Customization
    Can you help me with this issue?: So I tried to connect back to the Ethernet after trying to get a better download speed and it said my IP configuration wasn’t valid and that it won’t connect so after looking through and trying a couple methods online and none worked I restarted my pc and it presented me with...
  7. Task Scheduler with Windows OLE Excel

    in Windows 10 Customization
    Task Scheduler with Windows OLE Excel: Hi, I got the code block in Perl below. I can run via Command and get the output result. When I add a Task Scheduler via my Remote Desktop machine and I'm not getting any result. I have Administrator on this system and below is my setting. I did some search and folks...
  8. Task Scheduler Help

    in Windows 10 Ask Insider
    Task Scheduler Help: I created a one time task that would start at 11:30, and execute a bat file which puts the computer to sleep. It worked, but I can no longer find the task in task scheduler. Was it automatically deleted because this was a one time task? How do I find it? submitted by...
  9. Task Scheduling issue

    in Windows 10 Support
    Task Scheduling issue: So for past 5+ years I been using ccleaner to to automate the cleaning of temp dir and cookies upon system start up, via task scheduler and never had problem. I recently reinstalled windows 10 with clean install or 1803 as hell marry to see if it fixed the endless drivers...
  10. Task Scheduler issue

    in Windows 10 Support
    Task Scheduler issue: Been having this for some time now. I am on .14267 and for the last couple of builds I have been getting 'Task Scheduler is not available. Task Scheduler will attempt to reconnect to it'. Normally I can solve most problems but this has really baffled me and none of the...