Results 1 to 3 of 3

Set Name for Workbook in Macro Code

Threaded View

  1. #1
    Registered User
    Join Date
    02-27-2011
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    11

    Set Name for Workbook in Macro Code

    So I'm sure this is an easy one but I'm not sure how to really go about it as I'm fairly new to VBA. I have a line of code in the beginning that references a file name. I would like to be able to set a name or value for this file so that when I ever run this Macro I would only have to change the target or reference to that file rather than have to change it everywhere it appears in my code. This is my failed attempt at this:

    Set wb = Workbook("F:\Accts\Invoice\2011\92999_3-1-2011.xls(1).xls")
    
    Workbooks.Open "wb"
    I'm not sure if it's my naming or referencing that's keeping this file from opening or the way I'm trying to open it.
    Last edited by Jluc; 03-31-2011 at 04:21 PM.

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