ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Problem with 'Workbooks.OpenText (https://www.excelbanter.com/excel-programming/371738-problem-workbooks-opentext.html)

jo

Problem with 'Workbooks.OpenText
 
Hi,

Good Day..

I am using the following call to open an XML document. Its a "|"
delimited file.

Workbooks.OpenText Filename:=strDataFile, Origin:=xlWindows,
DataType:=xlDelimited, Semicolon:=False, _
Space:=False, Other:=True, OtherChar:="|",
ConsecutiveDelimiter:=False, TextQualifier:=xlTextQualifierDoubleQuote,
_
FieldInfo:=Array(Array(1, 2))

When i use the extension .xml the above call fails. It doesnt return
from this statement and just hangs for ever. But if i just change the
extension to .txt it works perfect and as expected. I tried using
'Workbooks.OpenXML but it fails
File cannot be opened because:
A semi colon character was expected.
Looks like OpenXML expects a semi colon delimited file.

Any help on this will be of great help./

thanks
Jo..



All times are GMT +1. The time now is 10:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com