Runtime Error

tagliaboo

New Member
Joined
Oct 25, 2019
Messages
5
I have an excel file with several macro that work fine on multiple computers. I have a new employee that just started and the macros do not work for him. He gets a runtime error -2147417848 (80010108). The specific macro is for creating a PDF is that matters. Not sure if it a setting in excel or version issue. Not the code since it works for everyone else.

Sub MO()
'
' MO Macro
'


Sheets("TC").Visible = True
Sheets("MO").Activate
ThisWorkbook.Sheets(Array("MO", "TC")).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
ThisWorkbook.Path & "" & ActiveSheet.Range("D11").Value & " Material Only ACM Proposal" & Format(Date, " MMDDYY") & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
Sheets("FO").Activate
Range("A1").Select
Sheets("TC").Visible = False
Sheets("ACM").Select
Range("B1").Select
End Sub
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Welcome to the forum!

I guess the error is in this line:

ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF

You already tried to manually create a PDF file from the new employee's excel.
If you cannot create the PDF, it means that your excel cannot create PDF and then you must install a new version.
If you can create the PDF, then activate the macro recorder, save the PDF, return to stop the macro, the generated code is pasted here to review it.
 
Last edited:
Upvote 0
Dante,

The employee in question has to open the two worksheets and create PDF's and then combine them in a PDF reader. All others just use the macro button I created and it does everything without error.
 
Upvote 0
Sub Macro1()
'
' Macro1 Macro
'

'
StandardWidth("IR").Select
Release "C:\Users\XXX\Desktop"
. SortOn := xlTypePDF, AutoSize := _
"C:\Users\XXX\Desktop\Proposal 11.05.19.pdf", := _
xlQualityStandard, := TRUE, := FALSE, := TRUE
End Sub
 
Upvote 0
That code is complete gibberish. I think you might need to reinstall.
 
Upvote 0
It worked fine, and popped up in adobe as it should. The XXX's are to mask the employee info, the recorded macro is unchanged other than that.
 
Upvote 0
As I said, that is absolute gibberish. What you posted will not compile or run.
 
Upvote 0
Code:
Sub Macro1()
'
' Macro1 Macro
'
 
'
    StandardWidth("IR").Select
    Release "C:\Users\XXX\Desktop"
    . SortOn := xlTypePDF, AutoSize := _
        "C:\Users\XXX\Desktop\Proposal 11.05.19.pdf",  := _
        xlQualityStandard,  := TRUE,  := FALSE,  := TRUE
End Sub


What version of excel and office does the user have?
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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