run time error 53, file not found

marcenet03

New Member
Joined
Apr 12, 2019
Messages
22
Hello, I have the following macro and used to run perfectly but now isn't working. As it shows run time error 53, file not found. Can someone please help me with what I'm missing?

VBA Code:
Sub printxxx()


' Print_quote XXX Macro

    ActiveSheet.PageSetup.Orientation = xlLandscape
    Worksheets("Quote").PageSetup.PrintArea = "$H$6:$Z$133"
     strFile = ThisWorkbook.Path & "\" & strFile
    
    

  ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
    ThisWorkbook.Path & "\" & CreateObject("Scripting.FileSystemObject").GetFile(ThisWorkbook.FullName).ParentFolder.Name & " XXXQuote ", _
    Quality:=xlQualityStandard, IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, OpenAfterPublish:=True


ActiveSheet.PageSetup.Orientation = xlPortrait
  
End Sub
 
it doesn't make sense when it used to work perfectly.
Perhaps when you used it previously the combination of the particular path/folder/filename was not as long as it is now?

Can you test the same code but a file with a shorter path/name structure?
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Perhaps when you used it previously the combination of the particular path/folder/filename was not as long as it is now?

Can you test the same code but a file with a shorter path/name structure?
I've already tried that. But still the same error.
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,933
Members
449,195
Latest member
Stevenciu

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