-
Feb 2nd, 2012, 07:10 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Data logger @ boot up
Is there a way to launch Excel in the background at system boot up and run a VBA macro to write information to a log file, then quit Excel?
-
Feb 2nd, 2012, 10:03 PM
#2
Fanatic Member
Re: Data logger @ boot up
As far as I know you can't run it in the background using a command-line switch. You could write an external app to call excel using its com interface. You could even use vbscript to do this if it is enabled on the system which is similar in syntax to vba. If a *.vbs file can't be run at startup you could call it from a batch file or something.
-
Feb 3rd, 2012, 06:13 AM
#3
Re: Data logger @ boot up
if you create a shortcut to a workbook, in the startup folder, you can have code in startup to set the application to visible = false, write your log file then quit the application without saving anything
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Feb 3rd, 2012, 07:02 PM
#4
Thread Starter
Fanatic Member
[Resolved] Data logger @ boot up
Thanks guys, the suggestions worked great! I put a shortcut of the vbscript file in the startup folder and everything works perfectly; Excel launches in background upon system boot and the log file gets updated w/o any sign that anything happened. Slick.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|