Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Open Text Method Fails

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Open Text Method Fails

Thanks Joel.

I changed the code and despite the change, the code continues to break when
I attempt to execute the file from within a web broswer. If I open the Excel
file native to Excel then the code works like a charm.

Thanks,
Mike

"Joel" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Open Text Method Fails

Is it breaking on the same line? What is the filename?

Usually from a webbrowser you need to reference thisworkbook if it is
breaking elsewhere in the code.

"Mike" wrote:

Thanks Joel.

I changed the code and despite the change, the code continues to break when
I attempt to execute the file from within a web broswer. If I open the Excel
file native to Excel then the code works like a charm.

Thanks,
Mike

"Joel" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Open Text Method Fails

Yes, it continues to break on the opentext line. The filename is obtained
from the user selection in the file dialog.

Could I add a new workbook and then reference the new workbook in the open
text method?

"Joel" wrote:

Is it breaking on the same line? What is the filename?

Usually from a webbrowser you need to reference thisworkbook if it is
breaking elsewhere in the code.

"Mike" wrote:

Thanks Joel.

I changed the code and despite the change, the code continues to break when
I attempt to execute the file from within a web broswer. If I open the Excel
file native to Excel then the code works like a charm.

Thanks,
Mike

"Joel" wrote:

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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Open Text Method Fails

Is the owner of the file the one who is trying to access the file. Make
sure you can open the file without using excel application. The priledge of
the file may not be set properly.

I think it is a file sharing issue or a read/write priledge issue. If you
open a window explorer (Not internet explorer) right click the file/folder.
There is a sharing option (may need to check properties). Since the
application is on the web you have to allow the file to be shared.

"Mike" wrote:

Yes, it continues to break on the opentext line. The filename is obtained
from the user selection in the file dialog.

Could I add a new workbook and then reference the new workbook in the open
text method?

"Joel" wrote:

Is it breaking on the same line? What is the filename?

Usually from a webbrowser you need to reference thisworkbook if it is
breaking elsewhere in the code.

"Mike" wrote:

Thanks Joel.

I changed the code and despite the change, the code continues to break when
I attempt to execute the file from within a web broswer. If I open the Excel
file native to Excel then the code works like a charm.

Thanks,
Mike

"Joel" wrote:

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

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default Open Text Method Fails

I have open access to all authenticated domain users for the site and
location where the file is located. I am the admininstrator of the site so
privilidges should not be an issue.

"Joel" wrote:

Is the owner of the file the one who is trying to access the file. Make
sure you can open the file without using excel application. The priledge of
the file may not be set properly.

I think it is a file sharing issue or a read/write priledge issue. If you
open a window explorer (Not internet explorer) right click the file/folder.
There is a sharing option (may need to check properties). Since the
application is on the web you have to allow the file to be shared.

"Mike" wrote:

Yes, it continues to break on the opentext line. The filename is obtained
from the user selection in the file dialog.

Could I add a new workbook and then reference the new workbook in the open
text method?

"Joel" wrote:

Is it breaking on the same line? What is the filename?

Usually from a webbrowser you need to reference thisworkbook if it is
breaking elsewhere in the code.

"Mike" wrote:

Thanks Joel.

I changed the code and despite the change, the code continues to break when
I attempt to execute the file from within a web broswer. If I open the Excel
file native to Excel then the code works like a charm.

Thanks,
Mike

"Joel" wrote:

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

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Open Text Method Fails

What error are you getting?

Some things to try is the is a break on error option in the VBA tools -
options menu. Try changing the setings.

Remember when running on the web you are running with the version of excel
on the server not the excel on your PC. Even though you have priledges on
you PC you may not have the same privledges on the server where th ewebpage
is located.

I don't knnow where you placed the webpage but you may want to put it on the
C: drive in a location where you know you have adminstarative priledges.

"Mike" wrote:

I have open access to all authenticated domain users for the site and
location where the file is located. I am the admininstrator of the site so
privilidges should not be an issue.

"Joel" wrote:

Is the owner of the file the one who is trying to access the file. Make
sure you can open the file without using excel application. The priledge of
the file may not be set properly.

I think it is a file sharing issue or a read/write priledge issue. If you
open a window explorer (Not internet explorer) right click the file/folder.
There is a sharing option (may need to check properties). Since the
application is on the web you have to allow the file to be shared.

"Mike" wrote:

Yes, it continues to break on the opentext line. The filename is obtained
from the user selection in the file dialog.

Could I add a new workbook and then reference the new workbook in the open
text method?

"Joel" wrote:

Is it breaking on the same line? What is the filename?

Usually from a webbrowser you need to reference thisworkbook if it is
breaking elsewhere in the code.

"Mike" wrote:

Thanks Joel.

I changed the code and despite the change, the code continues to break when
I attempt to execute the file from within a web broswer. If I open the Excel
file native to Excel then the code works like a charm.

Thanks,
Mike

"Joel" wrote:

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

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
Open tab text file method tony wong Excel Programming 1 August 4th 07 11:48 AM
method 'open text' of object 'workbooks' failed tina Excel Programming 6 September 20th 05 11:18 AM
Workbooks.open method fails JAT Excel Programming 3 January 24th 05 08:19 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
Open method of workbooks fails when Excel is hosted in IE [email protected] Excel Programming 5 January 30th 04 02:19 AM


All times are GMT +1. The time now is 12:10 PM.

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"