Consulting

Results 1 to 4 of 4

Thread: Running macros while logged off

  1. #1

    Exclamation Running macros while logged off

    Hi there,

    I have this posted in another forum but have yet to get any feedback so I figured I'd post it here as well. I put together a suite of macros to automate the running of reports through Excel. These reports fetch data from an ODBC connection, refresh a Pivot Table, create a copy of the workbook and save it to a designated folder. This works great for the majority of our clients. However, with newer clients running newer versions of Windows Server and Excel, the reports open and begin running but never finish, which causes the Excel process to be stuck open in the background. Now, this issue only occurs when the machine is logged off and these reports are kicked off via a Scheduled Task. II run the reports manually while logged in there is no issue. So it's the whole refrigerator door issue .

    I was just wondering if anyone here has come across similar issues with running macros via Scheduled Tasks while a machine is logged off. I would appreciate any help or advice here.

  2. #2
    VBAX Regular
    Joined
    Feb 2016
    Location
    Bangalore,India
    Posts
    11
    Location
    Hello Svetovich

    I have prepared one to tool in excel to capture the login and logout time , this code will run whenever they login to system and logoff the system.

    In windows system there will be one option startup and endup , means we can specify the applications or files to open or close whenever the system starts or logging off , if you write codes in the workbook close event and assign your excel file in endup option

    whene the try to log off excel will close , and runs the code,

    I don't know this idea works out for you or not , its working fine with me .

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    It sounds like there may be a version issue in the code itself.

    Do the newer versions of the Server require a login?

    when the machine is logged off
    I'm only 80% certain that means what I think it means.

    Do your "Macros" produce any Run Time logs? What do they report?
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    Have you set the scheduled task to run as a specific user? If so, do you have the credentials right for the task? For Database connections the user has often to be logged on otherwise the user authentication to the Database doesn't work.
    Regards,

    Jan Karel Pieterse
    Excel MVP jkp-ads.com

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •