Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Pass string as Parameter in OpenText method

Hi Folks
I am trying to import data from text file to
excel using OpenText method. It works fine . Can i pass a
string contains list of fields to be imported and thir
data type.

Workbooks.OpenText
FileName:="C:\ips\ips.txt", Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False,
Semicolon:=False, Comma:=True _
, Space:=False, Other:=False, FieldInfo:=Array
(Array(1, 2))

What i mean is
StrCode = "Array(Array(1,2))"

Workbooks.OpenText FileName:="C:\ips\ips.txt",
Origin:=xlWindows, _
StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False,
Semicolon:=False, Comma:=True _
, Space:=False, Other:=False, FieldInfo:= StrCode

Here i assign FieldInfo to variable strCode.

If u have any soultion please let me know.

Thanks & Regards
Niraj



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
Pass date parameter into MS Query Richard Edwards Excel Discussion (Misc queries) 2 June 20th 08 11:43 AM
Is it possible to pass a parameter into IN operator in Query? DennisS Excel Discussion (Misc queries) 0 June 26th 07 09:27 AM
How to: Pass Command Line Parameter ??? Webtest Excel Worksheet Functions 0 October 24th 05 05:27 PM
How to pass a workshhet name as a parameter into a subroutine ? yigalb Excel Discussion (Misc queries) 4 January 9th 05 10:28 AM
Can we Pass String to FieldInfo Array to OpenText Method. Niraj Kumar Singh Excel Programming 0 January 8th 04 05:35 AM


All times are GMT +1. The time now is 10: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"