Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application AutoRun or AutoStart

Status
Not open for further replies.

pbellc

Programmer
Jun 6, 2003
36
US
I don't know if Visual Basic can actually do this or not, but it can't hurt to ask. I need a file to automatically open every evening at a specific time. The file is an Excel file and it will reside on a Unix box. Any suggestions would be fantastic, be they VB or anything else.

Thanks.
 
If you periodically examine the system time using the Timer event of a timer:

Sub Timer1_Timer()
Dim objXlApp as Excel.Application

If Format(Now,"HH:mm") = "18:00" then
' Do Stuff
Set objXlApp = New Excel.Application
With objXlApp
.Visible = True
.WindowState = xlMinimized
.Workbooks.Open <Spreadsheet filename goes here>
End With
End If
End Sub

&quot;Logic is invincible because in order to combat logic it is necessary to use logic.&quot; -- Pierre Boutroux
 
THanks, AndyWatt. I'm glad to know that this is possible. My next question is (and this may sound a little basic) is: Where do I put that code? If I want this to open Excel, I can't write it in VB in Excel. So where else can I put it? THanks.
 
I'm guessing that you are writing a VB application to manipulate this Excel spreadsheet.

I'd suggest that the best place for the code is in the Timer event of a Timer control dropped onto a Form.

Regards,

Andy


&quot;Logic is invincible because in order to combat logic it is necessary to use logic.&quot; -- Pierre Boutroux
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top