Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with multiple Auto_Open Macro's
Anyway, I tried your suggestion and it seems to work! However, I figured
out that I also have to make sure that the names of the Excel Files don't contain a "-", because then the code you suggested doesn't work (the AUTO_OPEN macro is not found). Where workbook names include dash's, spaces and some other characters, for many operations the name needs to be embraced with apostrophes. Working with Tom's code, try changing the line: Application.Run mybook.Name & "!Auto_Open" to Application.Run Chr(39) & mybook.Name & "'!Auto_Open" It won't do any harm to include the apostrophes even if not required. Regards, Peter T "BuZzzy FF" wrote in message ... Hello Tom, It seems our messages crossed somehow (I'm sorry, it's probably me being completely new on this kind of discussion forums...) Anyway, I tried your suggestion and it seems to work! However, I figured out that I also have to make sure that the names of the Excel Files don't contain a "-", because then the code you suggested doesn't work (the AUTO_OPEN macro is not found). Conclusion: I have 2 solutions for the problem now: 1) Use the object method like Mr. Naik suggested and use the RunAutoMacros xlAutoOpen statement like I did originally, but insert also dummy calls since apparently only the 1st, 3th, 5th etc... call are succesful (the others are just skipped) 2) Use the Object Method like Mr. Ogilvy suggested, but make sure that the file names of the Excel files don't contain a "-". Thanks for your help! kind regards, Filip Henderieckx *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with multiple Auto_Open Macro's
Hello Peter,
Thanks for your help: This works. Regards, Filip *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with multiple Auto_Open Macro's
You're welcome, but it is of course Tom's suggestion and code that works for
you. My bit was trivial, to adapt to your particular needs. I imagine Tom would have told you something similar on his return. Regards, Peter T "BuZzzy FF" wrote in message ... Hello Peter, Thanks for your help: This works. Regards, Filip *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with multiple Auto_Open Macro's
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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to run Multiple Macro's in Worksheet? | Excel Discussion (Misc queries) | |||
Hide Macro's in Toolbar / Macro's list | Excel Discussion (Misc queries) | |||
macro's problem | Excel Discussion (Misc queries) | |||
How do you assign macro's to new menu with buttons on Auto_open? | Excel Programming | |||
How do you assign macro's to new menu with buttons on Auto_open? | Excel Programming |