wwrightchess
New Member
- Joined
- Apr 20, 2022
- Messages
- 29
- Office Version
- 365
- Platform
- MacOS
I am running the same process over a number of files. The first one opens and processes correctly but the second one fails.
I can open the file manually but in the macro it says it failed.
Error is "Method 'OpenText' of object 'Workbooks' failed.
I think the problem is I need to grant access to the folder for some reason but I do not know how to do that.
Here is the code (fullname is a string containing the path and name of the file)
I can open the file manually but in the macro it says it failed.
Error is "Method 'OpenText' of object 'Workbooks' failed.
I think the problem is I need to grant access to the folder for some reason but I do not know how to do that.
Here is the code (fullname is a string containing the path and name of the file)
VBA Code:
Workbooks.OpenText filename:=fullname, _
Origin:=xlMacintosh, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1), Array(15, 1), Array(30, 1), Array(45, 1), Array(60, 1), Array(75, 1), _
Array(90, 1), Array(105, 1), Array(120, 1), Array(135, 1), Array(150, 1), Array(165, 1), _
Array(180, 1)), TrailingMinusNumbers:=True
Last edited by a moderator: