By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,148 Members | 748 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,148 IT Pros & Developers. It's quick & easy.

Getting Error while using it on MAC

P: 8
hi,

The below code is working fine in Excel 2013 version to save a sheet as PDF but it giving error while running on MAC,

The Error Code is: "Run Time Error 438
Object Doesn't support this property of method.

Can anyone solve the issue.

Expand|Select|Wrap|Line Numbers
  1. Dim str As String, myfolder As String, myfile As String
  2.  
  3. str = "Do you want to save the sheet to a single pdf file?" & Chr(10)
  4. For Each sht In ActiveWindow.SelectedSheets
  5.     str = str & sht.Name & Chr(10)
  6. Next sht
  7.  
  8. answer = MsgBox(str, vbYesNo, "Continue with save?")
  9. If answer = vbNo Then Exit Sub
  10.  
  11. 'Ask for a directory
  12. With Application.FileDialog(msoFileDialogFolderPicker)
  13.     .Show
  14.     myfolder = .SelectedItems(1) & "\"
  15. End With
  16.  
  17. 'Ask for a file name
  18. myfile = InputBox("Enter file name", "Save as..")
  19.  
  20. 'Save sheets to pdf file
  21. ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
  22.     myfolder & myfile _
  23.     , Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
  24.     :=False, OpenAfterPublish:=True
Oct 25 '15 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.