Snuffepuff
New Member
- Joined
- Aug 27, 2014
- Messages
- 9
Hi,
I´ve recorded a macro that basiclly creates a new spreed sheet and copys over the data (format and values only) and saves it in the new one.
Everything workes fine until I tried to run it on another computer, then I get the message Run-time error "1004" and I´ve no idea whats wrong.
I´ve recorded a macro that basiclly creates a new spreed sheet and copys over the data (format and values only) and saves it in the new one.
Everything workes fine until I tried to run it on another computer, then I get the message Run-time error "1004" and I´ve no idea whats wrong.
Code:
Sub Expor()
'
' Export Macro
'
'
Application.ScreenUpdating = False
Workbooks.Add
ActiveWorkbook.SaveAs Filename:="C:\Offert test.xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
Windows("Offert.xlsm").Activate
Range("D5:BE70").Select
Selection.Copy
Windows("Offert test.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Cells.Select
Cells.EntireColumn.AutoFit
Cells.EntireRow.AutoFit
Cells.EntireRow.AutoFit
Cells.EntireColumn.AutoFit
Selection.ColumnWidth = 46.29
Cells.EntireColumn.AutoFit
Cells.EntireRow.AutoFit
Range("B5").Select
Application.CutCopyMode = False
ActiveWorkbook.Save
Windows("Offert.xlsm").Activate
ActiveWindow.ScrollColumn = 38
ActiveWindow.ScrollColumn = 37
ActiveWindow.ScrollColumn = 29
ActiveWindow.ScrollColumn = 1
ActiveWindow.SmallScroll Down:=-75
Application.ScreenUpdating = True
End Sub