Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Zik Zik is offline
external usenet poster
 
Posts: 1
Default Using Variables for file paths in QueryTables.Add

Hi,
I have the following script for querytable.add, I am trying to use a
variable for the path and file name under the connection property, but
so far I have not been successful in that.
Thanks,

Zik

With ActiveSheet.QueryTables.Add(Connection:= "TEXT;C:\Documents and
Settings\ _
, Destination:=Range("A1"))
.Name = "Viewer"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = True
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = True
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1)
.Refresh BackgroundQuery:=False
End With

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
Syntax for using variables in a cell formula to reference paths/fi colorado808 Excel Worksheet Functions 4 March 15th 07 03:41 AM
excel file paths Jane Excel Discussion (Misc queries) 1 August 17th 06 04:59 PM
file paths hr Excel Discussion (Misc queries) 0 December 7th 05 04:59 PM
Can you use QueryTables & iqy file to post web data? dazman[_8_] Excel Programming 0 August 14th 05 09:44 PM
ActiveSheet.QueryTables.Add using a File DSN Brian Howenstein Excel Programming 1 April 6th 04 11:45 AM


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

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

About Us

"It's about Microsoft Excel"