Permissions Issue in Running a Macro

skf786

Board Regular
Joined
Sep 26, 2010
Messages
156
Hi,

im using this macro to open the print as PDF window allowing user to save it as a PDF.

some of the users are getting "You do not have license for that function" message. Please help in fixing this.

thanks

KF

VBA Code:
Sub CreatePDF()
    Dim fName As String, fPath As String
    fPath = CreateObject("WScript.Shell").SpecialFolders("Desktop")
MsgBox fPath
    fName = Sheets("Cover Page").Range("A18").Value & " " & Format(Date, "dd-mm-yyyy")
    fPath = fPath & "\" & fName & ".pdf"
    ThisWorkbook.Sheets(Array("Cover Page", "Main Menu", "User Guide", "Market", "ITFA", "People", "Opex", "Marketing", "FundsInv", "BS", "PL", "CF", "Dashboard", "Sensitivity")).Select
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=fPath, _
        Quality:=xlQualityStandard, IncludeDocProperties:=True, _
        IgnorePrintAreas:=False, OpenAfterPublish:=True
    ThisWorkbook.Sheets("Cover Page").Select
End Sub
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Also, please note that these users are using mac machines. while the macro works fine on windows.
 
Upvote 0
On MacOS the Windows Script Host is not present, so CreateObject("WScript.Shell)" fails irrevocably.
 
Upvote 0

Forum statistics

Threads
1,214,515
Messages
6,119,974
Members
448,934
Latest member
audette89

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