Exporting a worksheet range as pdf

ChuckDrago

Active Member
Joined
Sep 7, 2007
Messages
470
Office Version
  1. 2010
Platform
  1. Windows
Hi everyone,

Got a tough one today (well, for me at least).

A workbook application collects data from the company server and populates a worksheet form (not UDF, just the sheet designed as a form). I need to grab the created datasheet form, copy it as a graphic to a Word document to finally save the Word document as a pdf to be attached to an email.

1) If there is a method unknown to me to save the worksheet as a pdf, I will appreciate the lesson.
2) If the two-step process I do manually is all I can do, I will also appreciate your guidance regarding translating it into VBA.

I am confused as a dog in a bowling alley.

Thank you all,

Chuck
 

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.
You can create a PDf like
Code:
Sub ChuckDrago()
   Dim Pth As String, Fname As String
   
   Pth = "C:\MrExcel\"
   Fname = "test1"
   Sheets("Pcode").Range("A1:I20").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
      Pth & Fname, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
      IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
 
Upvote 0
You can create a PDf like
Code:
Sub ChuckDrago()
   Dim Pth As String, Fname As String
   
   Pth = "C:\MrExcel\"
   Fname = "test1"
   Sheets("Pcode").Range("A1:I20").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
      Pth & Fname, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
      IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub

It works a treat!
Immense gratitude, Mr Fluff.
Not the first time I got great advise from you and every time spot on. Thanks again,
Chuck
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

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