Skyhawk32806
New Member
- Joined
- May 8, 2010
- Messages
- 26
I was looking around but I can't find a solution to this one...
I have another program that writes out a .txt file. I then have a macro to open the file, and then run some macros on it. However as soon as the .txt file is opened in Excel the macros stop running, without any error messages.
It looks like when the txt file is opened it, ALWAYS opens with Design Mode selected. Please see below for a snippit of my code...
I ended up using...
The secound meathod seems to work, however I can't seem to get the text import wizard to invoke.
So I guess my question is, how do I open the text file with the Text Import Wizard and continue to run the macro after that? I'm not sure what I'm missing here.
Thanks everyone!!
I have another program that writes out a .txt file. I then have a macro to open the file, and then run some macros on it. However as soon as the .txt file is opened in Excel the macros stop running, without any error messages.
It looks like when the txt file is opened it, ALWAYS opens with Design Mode selected. Please see below for a snippit of my code...
Code:
Sub Macro2()
'
'Open the text file, this part works
Workbooks.OpenText Filename:= _
"C:\My File.txt", Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(10 _
, 1), Array(51, 1), Array(69, 1)), TrailingMinusNumbers:=True
'Everything after this point will not run.
End Sub
I ended up using...
Code:
Workbooks.Add "C:\My File.txt"
The secound meathod seems to work, however I can't seem to get the text import wizard to invoke.
So I guess my question is, how do I open the text file with the Text Import Wizard and continue to run the macro after that? I'm not sure what I'm missing here.
Thanks everyone!!