PDA

View Full Version : Running macros while logged off



svetovich
02-15-2016, 08:33 AM
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 :banghead:.

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.

shailendranr
02-22-2016, 06:09 AM
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 .

SamT
02-22-2016, 09:19 AM
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?

Jan Karel Pieterse
02-22-2016, 10:04 PM
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.