View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Open Text Method Fails

This is all you really need. the other part of the code is probably creating
the errors.


Workbooks.OpenText Filename:=fname, _
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, _
Other:=True, OtherChar:="|", _
TrailingMinusNumbers:=True


"Mike" wrote:

Hello,

I have an excel file hosted from a MS Sharepoint site. If a user opens the
file in Excel, the program executes fine. If the user opens the file in a web
browser my program terminates at the below line.

The error message states Run-Time error 1004. Method OpenText of object
workbooks failed.

Workbooks.OpenText Filename:= _
fname, Origin:=437, StartRow:=1, DataType:=xlDelimited,
TextQualifier:=xlDoubleQuote, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=False, Comma:=False _
, Space:=False, Other:=True, OtherChar:="|", FieldInfo:=Array(Array(1, 1 _
), Array(2, 2), Array(3, 1), Array(4, 1), Array(5, 2), Array(6, 1), Array(7,
1), Array(8, 1), _
Array(9, 1), Array(10, 1), Array(11, 1), Array(12, 1)),
TrailingMinusNumbers:=True