11 replies
by dklippert
You may be looking for:
Auto_Open
Auto_Close
But also look at:
www.cpearson.com/excel/ontime.htm
by gcheels
by ammartq
Start excel file in which you need to use the macro. Press Alt+F11 (both keys together).
Double-click "ThisWorkbook" from left, top box. Select "Workbook" from top center combo box. You will see following function in main text area:
Private Sub Workbook_Open()
End Sub
Whatever you write between these two lines will be run when your excel file starts.
by gcheels
by ammartq
by gcheels
by ammartq
You said you "need to know how to automatically start the macro when the spreadsheet file opens and after it finishes it's processing, save the file (with no prompt to overwrite the file) and close Excel."
Thats what I told you. If you want me togive you the code to get the data from Access, you should have clearly specified that in the question. Rather you said that YOU intend to do... so I thought you will write the data collection yourself. :)
by gcheels
by firstpeter
Perhaps this will help:
1. Start Excel.
2. Press Alt-F11 to enter the Visual Basic Editor.
3. Select the "ThisWorkbook" branch under "VBAProject(Book1)" by double-clicking on it [Book1 is the name of your Excel workbook].
4. The code you'll want to type in the code pane is:
Private Sub Workbook_Open()
<< Your data retrieval code here >>
ActiveWorkbook.Close savechanges:=True
End Sub
Does that help?
by gcheels
by gcheels
This discussion is closed to new replies.
Trending Software posts
Sort by Trending