Results 1 to 3 of 3

Need current Filename for macro application command

Threaded View

  1. #1
    Registered User
    Join Date
    06-20-2013
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Need current Filename for macro application command

    I made an ActiveX button to run a macro that alters more than solely the sheet it was created upon (I'm assuming that was the initial issue) it works great now, but the reference to run is set to the filename. Every time I save it as a new revision I have to edit the code.

        Application.Run "'Density Log REV.12.xls'!ThisWorkbook.dbCREATEtestable"
    Is there a way to set the filename to current in VBA without referencing a cell with

    =MID(CELL("filename"),SEARCH("[",CELL("filename"))+1, SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))-1)
    Thank you in advance!



    Wow,
    Figured it out shortly after posting.

        Application.Run "'ThisWorkbook.dbCREATEtestable"
    take out the reference!
    Last edited by Soemd; 06-22-2013 at 02:52 PM. Reason: solved

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