variandick
New Member
- Joined
- Nov 24, 2009
- Messages
- 1
I have been told some people are having trouble running Excel VBA Macros with Windows 7. It doesn't seem reasonable but has anyone heard of any problems?
Sub Macro1()
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\My Documents\test.txt", Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(5, _
1)), TrailingMinusNumbers:=True
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\My Documents\test.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False _
, CreateBackup:=False
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\My Documents\test.txt", Origin:=437, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(6, _
1)), TrailingMinusNumbers:=True
Range("A1:A7").Select
Selection.Copy
Windows("test.xls").Activate
Range("B1").Select
ActiveSheet.Paste
Range("A1").Select
End Sub
Do you have Office fully patched up to date? Are you running Windows Defender?