netwerkz
11-25-2014, 08:40 AM
This part of my script has been working for almost a year now, but it's failing with "run-time error '1004': incorrect function - ActiveWorkbook.SaveAs" now.
Public Sub VendorRecon()
'
' This section prepares the yyyy Mmm - Vendor Recon File.xlsx
'
Call openxmlfile
Call borders
Call SSN
Call USD
Call dates
Call FName
Call LName
Call freeze
year_Month = Format(DateAdd("m", 1, Date), "yyyy mmm")
yearMonth = Format(DateAdd("m", 1, Date), "yyyymmm")
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "" & year_Month & " - Vendor Recon File"
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With
ActiveWorkbook.SaveAs Filename:= _
"\\san\ppc\vendors\Forms and Files\2014\" & year_Month & " \ " & year_Month & " - Vendor Recon File.xlsx" _
, FileFormat:=51, Password:="", WriteResPassword:="", CreateBackup:=False
The hang up is in the last section. Any clues?
Thanks.
Public Sub VendorRecon()
'
' This section prepares the yyyy Mmm - Vendor Recon File.xlsx
'
Call openxmlfile
Call borders
Call SSN
Call USD
Call dates
Call FName
Call LName
Call freeze
year_Month = Format(DateAdd("m", 1, Date), "yyyy mmm")
yearMonth = Format(DateAdd("m", 1, Date), "yyyymmm")
Sheets("Sheet1").Select
Sheets("Sheet1").Name = "" & year_Month & " - Vendor Recon File"
With ActiveSheet.PageSetup
.Orientation = xlLandscape
End With
ActiveWorkbook.SaveAs Filename:= _
"\\san\ppc\vendors\Forms and Files\2014\" & year_Month & " \ " & year_Month & " - Vendor Recon File.xlsx" _
, FileFormat:=51, Password:="", WriteResPassword:="", CreateBackup:=False
The hang up is in the last section. Any clues?
Thanks.