+ Reply to Thread
Results 1 to 3 of 3

Renaming Spreadsheet causes macros to fail

Hybrid View

  1. #1
    Registered User
    Join Date
    04-24-2008
    Posts
    85

    Renaming Spreadsheet causes macros to fail

    Hello,
    I have a quick and hopefully very easy question.

    I have this code that runs several macros for me:

        Application.Run "'Working.xls'!Step2"
        Application.Run "'Working.xls'!Step3"
        Application.Run "'Working.xls'!Step4"
    My question is can I take out the "working.xls" part and put something else in its place? This spreadsheet will be taken by many people and renamed, etc...

    I noticed that when I rename the spreadsheet, the macro's fail because it can't find working.xls

    Any suggestions/comments would be greatly appreciated.
    Thanks,

    Adam Parker

  2. #2
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,177
    The macro must belong to "Working.xls" workbook. I think once you "save as" the originating workbook is no longer open and the macro would no longer be available.

    You could put the macros in a "personal.xls", place that on each computer and they will have access to the macro regardless of the active workbook name.

        Application.Run "'Personal.xls'!Step2"
        Application.Run "'Personal.xls'!Step3"
        Application.Run "'Personal.xls'!Step4"
    Regards

    Rick
    Win10, Office 365

  3. #3
    Forum Contributor
    Join Date
    02-23-2006
    Location
    Near London, England
    MS-Off Ver
    Office 2003
    Posts
    770
    Is this code contained within the same workbook as the macros it's calling, or is it in a different workbook?

+ 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