Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set Excel to auto open a document into a new Window even. dixiebee Excel Worksheet Functions 1 December 15th 04 09:28 PM
Auto Open a CD and run an Excel file Larry[_14_] Excel Programming 2 October 20th 04 02:40 PM
Auto execute macro when open excel bris Excel Programming 2 September 21st 04 09:52 AM
Auto open macros in Excel Tammy[_4_] Excel Programming 1 February 21st 04 02:30 AM
Auto Open Excel at Specific Sheet John[_41_] Excel Programming 0 August 1st 03 04:42 PM


All times are GMT +1. The time now is 01:41 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"