Invalid procedure call (Error 5)

Pastafarian

New Member
Joined
Feb 21, 2012
Messages
30
Fellow Excellers,

I have a code to make PDF's from Excel worksheets. It's working correctly at my place, but at a client's its not working properly.

The code for getting the sheet to PDF is as following, with the errorline in bold/underlined:
Code:
[B][U]ws.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\Company\Quotations\" & filenaam & ".PDF"[/U][/B]

    
Application.DisplayAlerts = True
Application.ScreenUpdating = False
    MsgBox (customer & " - PDF saved in C:\Company\Quotations"), , customer & " - PDF Quotation Saved"
    


ws.Rows("31:31").EntireRow.Hidden = False
ws.Rows("50:50").EntireRow.Hidden = False
ws.Rows("56:56").EntireRow.Hidden = False
ws.Rows("59:59").EntireRow.Hidden = False
ws.Rows("63:63").EntireRow.Hidden = False
ws.Rows("67:67").EntireRow.Hidden = False

Sheets("Quotation").ShowAllData

Before the part of saving to PDF the code creates an autofilter and hides some rows I don't want to see on the PDF.

According to Microsoft.com, is has something to do with 'An argument probably exceeds the range of permitted values.', but according to me this is not the case.

Anyone knows how to deal with this problem?

Thanks!;)
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

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