HeY all,
Heres the deal, getting a error message when opening a workbook "Runtime error 1004" I dont know much about excel and the user explained it to me as best she could . Here is where the script bugs:
Sub auto_open()
fdist = ActiveWorkbook.Name
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Worksheets("f_cumul").Cells.ClearContents
Worksheets("f_cumul").Cells.ClearFormats
Worksheets("vtes_dj").Select
Range("a1").Select
Selection.End(xlDown).Select
lf = ActiveCell.Row
Range(Cells(2, 1), Cells(lf, 7)).ClearContents
Range(Cells(2, 1), Cells(2, 7)).Value = "x"
Workbooks.Open Filename:="\\LIVE\VOL11\DB_DIST\FOURNIER\CO2_INFO.XLS", ReadOnly _
:=True
Range("A2").Select
ActiveWindow.Visible = False
Workbooks.Open Filename:="\\LIVE\VOL6\Dept\FOURNIER\F_CUMUL.XLS", _
ReadOnly:=True
Sheets("sheet1").Select
Columns("a:g").Copy
Windows(fdist).Activate
Worksheets("f_cumul").Cells(1, 1).PasteSpecial Paste:=xlValues
Workbooks("f_cumul.xls").Close
Windows(fdist).Activate
Worksheets("f_cumul").Columns("D:D").NumberFormat = "d-mmm-yy"
Worksheets("reserve").Select
Columns("e:g").ClearContents
Selection.QueryTable.Refresh BackgroundQuery:=False
Workbooks.Open Filename:="\\live\VOL11\DB_DIST\FOURNIER\RAP_FOU.XLS", _
UpdateLinks:=0, ReadOnly:=True
Sheets("rap_fait").Select
Columns("A:K").Select
Selection.Copy
Windows(fdist).Activate
Sheets("rap_encours").Select
Range("a1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Columns("I:I").Select
Application.CutCopyMode = False
Selection.NumberFormat = "dd-mmm-yy"
Windows("rap_fou.xls").Close
Windows("fou_dist.xls").Activate
Sheets("dist").Select
Range("s5").Select
'Workbooks(fdist).Save
End Sub
Thanks for any help
EDIT: bolded text is where the macro fails.
Thanks
Bookmarks