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 |
All times are GMT +1. The time now is 07:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com