Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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
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
String variables John New Users to Excel 3 July 16th 06 09:08 PM
Inserting variables within file names kestrel Excel Worksheet Functions 3 June 16th 06 08:00 PM
Parse String into Variables Gary''s Student Excel Programming 3 September 21st 05 03:32 PM
String Variables [email protected] Excel Programming 1 August 30th 03 07:28 AM
variables for file names mike Excel Programming 1 July 9th 03 11:39 PM


All times are GMT +1. The time now is 09:41 PM.

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"