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