I need a macro to close a workbook then re open it
i figure i can do this using a macro from my perosnal.xls. as it will remain open
any ideas how i'd call that from another workbook or any suggestions on how this is possible?
cheers
I need a macro to close a workbook then re open it
i figure i can do this using a macro from my perosnal.xls. as it will remain open
any ideas how i'd call that from another workbook or any suggestions on how this is possible?
cheers
Last edited by VBA Noob; 05-30-2008 at 08:41 AM.
Mr MaGoo
Magoo.Inc MMVII
If i've helped please add to my Rep by Clicking on the Blue Scales in the top right hand corner of the post
put the following code into the ThisWorkbook file that is on the left hand side in VBA with the little excel icon.
Sub Workbook_Open()
Workbooks("sample.xls").Activate
ActiveWorkbook.Close
Workbooks.Open Filename:="c:\sample.xls"
End Sub
cheers
really no need for the "little excel icon" part lol i know me way around by now lol
thanks for the help dude!!!! my code was similar to this!!
Actually the code that I wrote earlier was a bit specific. It would activate when you open the initial workbook. However, the body of the code is the same if you want to use the procedure in a module.
Sub ThisModuleClosesAndReopensAnotherWorkbook()
Workbooks("sample.xls").Activate
ActiveWorkbook.Close
Workbooks.Open Filename:="c:\sample.xls"
End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks