Short Cut Key Semi Working

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
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top