Saving as a PDF using VBA

wilsond264

New Member
Joined
Oct 10, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. MacOS
Hello , I'm new to the forum. I have been trying to learn to write macros for the past few several weeks now, I have been working on a invoice form that I have created. I am trying to set up a macro that will allow me to save my document to a folder on my hard drive as a PDF. I am not able to save, I keep getting an error message, not sure what I'm doing wrong. here is a screen shot of the macro and error message. I would appreciate any help. I am running Office 2016 on a Mac. Thanks
 

Attachments

  • Screen Shot 2020-10-10 .jpg
    Screen Shot 2020-10-10 .jpg
    87.6 KB · Views: 11

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
VBA Code:
Option Explicit

Sub Save_Click()
  ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Range("H7").Value & ".pdf"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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