Copying data to a new spreed sheet - "Run time error 1004"

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.

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
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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