method 'SaveAs' of object '_Workbook' failed

Status
Not open for further replies.

rplohocky

Active Member
Joined
Sep 25, 2005
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hello,
I keep getting this error when my macro hits the "saveas" point. I've spent hours trying to figure out what's wrong. Any idea's?
Code:
Sub FormatTagExpiration()
'
' This macro opens specific workbooks to "clean" them up for processing them into a summary workbook.
'
    Dim src As Workbook
    Set src = Workbooks("313670 Avanir Biweekly Dashboard Report.xlsm")
    
'Below set a CELL reference to the("313670 Avanir Biweekly Dashboard Report.xlsm") workbook.
'The numbers below refer to row number and column number respectivly. (33, 4) 33= row, 4 = column.
    Dim cellValueFolderName As String
    Dim cellValueFolderName1 As String

    cellValueFolderName = src.Worksheets("Data").Cells(168, 2) 'New folder name.
    cellValueFolderName1 = src.Worksheets("Data").Cells(168, 1) 'New folder name without the slash.

'Below goes back to "Template.xlsx" and does a saveas.
    Windows("Template.xlsx").Activate
    Application.DisplayAlerts = False ' suppress overwrite warning message
    ThisWorkbook.SaveAs Filename:="\\fleet.ad\data\Data1\VMSSHARE\FS\FPSCOEASSO\Temporary Fleet Reports\313670 Avanir\Final Result\" & cellValueFolderName & "313670 Avanir Biweekly Dashboard " & cellValueFolderName1 & ".xlsx"
    Application.DisplayAlerts = True
    
End Sub

I also tried ActiveWorkbook as well, no luck.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Status
Not open for further replies.

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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