+ Reply to Thread
Results 1 to 2 of 2

Constructing a path to open file

Hybrid View

  1. #1
    Francis Brown
    Guest

    Constructing a path to open file

    Thanks to previous replies I now have the global variable I need to construct
    the network path to a user store file.

    The variable CommandN has the no. of 1-7 which dictates a users management
    area.

    I need to use this to construct the network path to use in a workbooks.open
    command.

    e.g
    workbooks.open("Z:/Systemdown/"&CommandN&"/Userfile.xls")

    The module won't compile like this.

    Can someone show how to write this line correctly.

    Regards and Thanks for any assistance.

    Francis Brown.

  2. #2
    Chip Pearson
    Guest

    Re: Constructing a path to open file

    Remove the opening and closing parentheses, and put spaces around
    your '&' characters. Without the spaces, VBA treats the &
    character as a data type specifier, not a concatenation operator.


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "Francis Brown" <FrancisBrown@discussions.microsoft.com> wrote in
    message
    news:A230323D-6F4A-4705-9E61-D0D1A5460404@microsoft.com...
    > Thanks to previous replies I now have the global variable I
    > need to construct
    > the network path to a user store file.
    >
    > The variable CommandN has the no. of 1-7 which dictates a users
    > management
    > area.
    >
    > I need to use this to construct the network path to use in a
    > workbooks.open
    > command.
    >
    > e.g
    > workbooks.open("Z:/Systemdown/"&CommandN&"/Userfile.xls")
    >
    > The module won't compile like this.
    >
    > Can someone show how to write this line correctly.
    >
    > Regards and Thanks for any assistance.
    >
    > Francis Brown.




+ 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