+ Reply to Thread
Results 1 to 3 of 3

string variables in file names

  1. #1
    dr chuck
    Guest

    string variables in file names

    Can i use a defined string variable in a file name when opening? if so what
    is the appropriate syntax?

    example....

    Workbooks.Open Filename:= _
    "C:\Documents and Settings\HP_Owner\Desktop\PanelSelect\panels\16-1
    letterO.xls"

    i want to use a string variable named "antfile" in place of the file name
    16-1letterO.xls

    --
    dr chuck

  2. #2
    Dave Peterson
    Guest

    Re: string variables in file names

    Yep:

    dim antfile as string
    antfile = "somestringhere"

    Workbooks.Open Filename:= _
    "C:\Documents and Settings\HP_Owner\Desktop\PanelSelect\panels\" & antfile


    dr chuck wrote:
    >
    > Can i use a defined string variable in a file name when opening? if so what
    > is the appropriate syntax?
    >
    > example....
    >
    > Workbooks.Open Filename:= _
    > "C:\Documents and Settings\HP_Owner\Desktop\PanelSelect\panels\16-1
    > letterO.xls"
    >
    > i want to use a string variable named "antfile" in place of the file name
    > 16-1letterO.xls
    >
    > --
    > dr chuck


    --

    Dave Peterson

  3. #3
    dr chuck
    Guest

    Re: string variables in file names

    thanks for the syntax help dave.

    --
    dr chuck


    "Dave Peterson" wrote:

    > Yep:
    >
    > dim antfile as string
    > antfile = "somestringhere"
    >
    > Workbooks.Open Filename:= _
    > "C:\Documents and Settings\HP_Owner\Desktop\PanelSelect\panels\" & antfile
    >
    >
    > dr chuck wrote:
    > >
    > > Can i use a defined string variable in a file name when opening? if so what
    > > is the appropriate syntax?
    > >
    > > example....
    > >
    > > Workbooks.Open Filename:= _
    > > "C:\Documents and Settings\HP_Owner\Desktop\PanelSelect\panels\16-1
    > > letterO.xls"
    > >
    > > i want to use a string variable named "antfile" in place of the file name
    > > 16-1letterO.xls
    > >
    > > --
    > > dr chuck

    >
    > --
    >
    > 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