LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default method 'open text' of object 'workbooks' failed

Hi
A user has a new pc running windows xp office 2000 and since cannot run a
macro I wrote which opens a .txt file manualy the file can be openned on new
pc .
I even record macro it recorded all key strokes and opened file but when I
tried recorded macro it failed with message
file cannot be accessed file maybe read only or read only location or server
document is on is not responding retry or cancel the vb message is run time
error 1004
method 'open text' of object 'workbooks' failed
as can be done manually why not as macro if I save file as .xls then write
macro macro works but do not want to do this

the macro i recorded is as follows
Sub Macro1()

Workbooks.OpenText Filename:="L:\SYMDATA\Amy\060905.txt",
Origin:=xlWindows _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 2),
Array( _
7, 1), Array(39, 1), Array(47, 1), Array(53, 1), Array(59, 1),
Array(70, 4), Array(83, 4), _
Array(95, 4), Array(107, 1), Array(117, 1), Array(123, 1),
Array(131, 1), Array(143, 1), _
Array(152, 1))
End Sub
any ideas would be much appreciated
Thanks Tina


 
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
Method Add of object Validation Failed - please help Shokie Excel Worksheet Functions 1 July 10th 09 01:33 PM
method of axes of object failed Papa Jonah Excel Programming 2 October 20th 04 04:59 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 class failed kiran[_2_] Excel Programming 0 November 6th 03 09:58 PM
Method ~ of Object ~ Failed. Joan Excel Programming 5 August 26th 03 08:13 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"