[RESOLVED] Data logger @ boot up-VBForums
Results 1 to 4 of 4

Thread: [RESOLVED] Data logger @ boot up

  1. #1

    Thread Starter
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    590

    Resolved [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?

  2. #2
    Fanatic Member dmaruca's Avatar
    Join Date
    May 2006
    Location
    Jacksonville, FL
    Posts
    542

    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.

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    20,003

    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

  4. #4

    Thread Starter
    Fanatic Member VBAhack's Avatar
    Join Date
    Dec 2004
    Location
    Sector 000
    Posts
    590

    Thumbs up [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
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.