Save as PDF does not work when I do not have a printer

drom

Well-known Member
Joined
Mar 20, 2005
Messages
527
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
Hi!
When I click Control + F2, I can see a print preview on my active sheet.

But some times since I do not have any printer, I see nothing, unless I change the printer setting to put eg: Nitro or something else.
If I do so I can use the print preview perfect

Now.

I am using a file located in a public folder, and my working mates are using a macro.
This macro creates a workbook and saves a temp file (1 Excel + 1 PDF) in a folder and sends the file and the PDF file to a few customers using outlook
The macro works fine if I can see a print preview before using the calling the macro, otherwise I cant attach the PDF file in a mail

Is there anything I can do?

At present I am using:


VBA Code:
  wFxFN = "":                       wFxFN = wPath & wDate & wCustomer & ".xlsx"
  wPDFfn = "":                      wPDFfn = wPath & wDate & wCustomer & ".PDF"
  Kill wFxFN:                       Kill wPDFfn
    ActiveWorkbook.SaveAs Filename:=wFxFN, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPDFfn, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
    If ActiveWorkbook.Name <> ThisWorkbook.Name Then      ActiveWorkbook.Close

So looks like if Excel does not see anything to preview, (I mean a printer) does not save the PDF
As a temporary solution my friends are using CONTROL + F2 (PrintPreview) to select a printer because once this is done the prior macro saves the Excel Activesheet as a PDF

But is the any solution and/or what am I missing?

Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi!
When I click Control + F2, I can see a print preview on my active sheet.

But some times since I do not have any printer, I see nothing, unless I change the printer setting to put eg: Nitro or something else.
If I do so I can use the print preview perfect

Now.

I am using a file located in a public folder, and my working mates are using a macro.
This macro creates a workbook and saves a temp file (1 Excel + 1 PDF) in a folder and sends the file and the PDF file to a few customers using outlook
The macro works fine if I can see a print preview before using the calling the macro, otherwise I cant attach the PDF file in a mail

Is there anything I can do?

At present I am using:


VBA Code:
  wFxFN = "":                       wFxFN = wPath & wDate & wCustomer & ".xlsx"
  wPDFfn = "":                      wPDFfn = wPath & wDate & wCustomer & ".PDF"
  Kill wFxFN:                       Kill wPDFfn
    ActiveWorkbook.SaveAs Filename:=wFxFN, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=wPDFfn, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
    If ActiveWorkbook.Name <> ThisWorkbook.Name Then      ActiveWorkbook.Close

So looks like if Excel does not see anything to preview, (I mean a printer) does not save the PDF
As a temporary solution my friends are using CONTROL + F2 (PrintPreview) to select a printer because once this is done the prior macro saves the Excel Activesheet as a PDF

But is the any solution and/or what am I missing?

Thanks
If you set your PDF printer as standard, you will see the Print preview by using Ctrl + F2
 
Upvote 0

Forum statistics

Threads
1,214,791
Messages
6,121,611
Members
449,038
Latest member
apwr

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