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

drom

Active Member
Joined
Mar 20, 2005
Messages
441
Office Version
  1. 2019
  2. 2016
  3. 2013
  4. 2011
  5. 2010
  6. 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
 

Some videos you may like

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.

ebea

Board Regular
Joined
Jul 12, 2008
Messages
206
Office Version
  1. 2010
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,118,656
Messages
5,573,432
Members
412,529
Latest member
cTatch
Top