+ Reply to Thread
Results 1 to 2 of 2

Auto Open Excel

Hybrid View

Guest Auto Open Excel 01-28-2005, 02:06 PM
Guest Re: Auto Open Excel 01-28-2005, 10:06 PM
  1. #1
    David Kemp
    Guest

    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. #2
    Dave Peterson
    Guest

    Re: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1