Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Open Excel
Hi All, Hope some of you are still around! I tried using this as well but got an error. -----------------------------------------------------CODE Sub OpenWorkbooks() Dim myBook As Workbook Set myBook = Workbooks.Open(Filename:="C:\Documents and Settings\kempdav1\My Documents\FBR\FBR Report v5 7075005.xls") With myBook Application.Run myBook.Name & "!Auto_Open" .Close SaveChanges:=True End With Set myBook = Workbooks.Open(Filename:="C:\Documents and Settings\kempdav1\My Documents\FBR\FBR Report v5 7051008.xls") With myBook Application.Run myBook.Name & "!Auto_Open" .Close SaveChanges:=True End With Set myBook = Nothing End Sub --------------------------------------------------ENDCODE I get the error:- run time error 1004 The macro 'FBR Report v5 7075005.xls!Auto_Open' cannot be found. I am not big on coding or excel so its probably something obvious, any ideas would be much appeciated. Many thanks, David *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto Open Excel
Maybe it's those pesky spaces...
Application.Run "'" & myBook.Name & "'!Auto_Open" David Kemp wrote: Hi All, Hope some of you are still around! I tried using this as well but got an error. -----------------------------------------------------CODE Sub OpenWorkbooks() Dim myBook As Workbook Set myBook = Workbooks.Open(Filename:="C:\Documents and Settings\kempdav1\My Documents\FBR\FBR Report v5 7075005.xls") With myBook Application.Run myBook.Name & "!Auto_Open" .Close SaveChanges:=True End With Set myBook = Workbooks.Open(Filename:="C:\Documents and Settings\kempdav1\My Documents\FBR\FBR Report v5 7051008.xls") With myBook Application.Run myBook.Name & "!Auto_Open" .Close SaveChanges:=True End With Set myBook = Nothing End Sub --------------------------------------------------ENDCODE I get the error:- run time error 1004 The macro 'FBR Report v5 7075005.xls!Auto_Open' cannot be found. I am not big on coding or excel so its probably something obvious, any ideas would be much appeciated. Many thanks, David *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I set Excel to auto open a document into a new Window even. | Excel Worksheet Functions | |||
Auto Open a CD and run an Excel file | Excel Programming | |||
Auto execute macro when open excel | Excel Programming | |||
Auto open macros in Excel | Excel Programming | |||
Auto Open Excel at Specific Sheet | Excel Programming |