Tiggerbasher
New Member
- Joined
- May 27, 2010
- Messages
- 8
Hi
In Excel 2007, I have recorded a simple macro to open a text file and save as an .xls file, assigning a short cut key in the process.
' Keyboard Shortcut: Ctrl+Shift+P
Application.DisplayAlerts = False
Workbooks.OpenText Filename:="J:\FIT\SPOOLLV\LOGFILE.TXT", Origin:=xlMSDOS _
, StartRow:=1, DataType:=xlFixedWidth, OtherChar:="³", FieldInfo:=Array _
(0, 1), TrailingMinusNumbers:=True
ActiveWorkbook.SaveAs Filename:="C:\LOGFILE.xls", FileFormat:=xlExcel8, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
If I run the macro via the shortcut key it will part work in that it opens up the text file.
If I assign the macro to a button, or run directly it will run to fruition.
Any ideas?
Thanks Gary
In Excel 2007, I have recorded a simple macro to open a text file and save as an .xls file, assigning a short cut key in the process.
' Keyboard Shortcut: Ctrl+Shift+P
Application.DisplayAlerts = False
Workbooks.OpenText Filename:="J:\FIT\SPOOLLV\LOGFILE.TXT", Origin:=xlMSDOS _
, StartRow:=1, DataType:=xlFixedWidth, OtherChar:="³", FieldInfo:=Array _
(0, 1), TrailingMinusNumbers:=True
ActiveWorkbook.SaveAs Filename:="C:\LOGFILE.xls", FileFormat:=xlExcel8, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
If I run the macro via the shortcut key it will part work in that it opens up the text file.
If I assign the macro to a button, or run directly it will run to fruition.
Any ideas?
Thanks Gary