Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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" wrote in
message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
Default Path for File Open gilgil Excel Programming 2 March 6th 05 10:36 AM
Open File with Spaces in Path J Excel Programming 5 November 2nd 04 02:52 PM
File open with Path Name rickey24[_8_] Excel Programming 4 July 8th 04 01:04 AM
How set file open path to filepath of file opened with Explorer ? RandyDtg1 Excel Programming 0 May 14th 04 02:05 AM


All times are GMT +1. The time now is 05:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"