+ Reply to Thread
Results 1 to 5 of 5

In Workbook running macro with relative path

  1. #1
    Registered User
    Join Date
    07-07-2008
    Location
    Bath
    MS-Off Ver
    Microsoft Office 2007
    Posts
    42

    In Workbook running macro with relative path

    Hi,

    I have following macro in my file:
    Sub Hide_button()
    Application.Run "'Generic Order Form NEW_VERSION_template.xls'!hideUnhideZeros"
    Application.Run "'Generic Order Form NEW_VERSION_template.xls'!Header"
    Application.Run "'Generic Order Form NEW_VERSION_template.xls'!FontWhite"
    End Sub
    I would like the application to run also after I rename the file. I did look at the forums but couldn't find an answer to my question. : (
    I would need something like this:
    Application.Run "'ThisWorkbook.path'!Header"

    Thanks for you help.

    Regards,
    George

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Why not either store the macros in PERSONAL.xls or create an addin?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    07-07-2008
    Location
    Bath
    MS-Off Ver
    Microsoft Office 2007
    Posts
    42
    Hi Roy,

    Thanks for your reply.

    Sadly I have no idea how I could create an addin

    We use this quote form a lot and we always save it with different order numbers, but I can't figure out a way that I would have a relative path for the workbook.

    Hope it makes sence ...

    Thanks,
    George

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Search the forum and google for create excel addin

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064
    If the macros are in the same file, you don't need Application.Run at all:
    Please Login or Register  to view this content.

+ 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