drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and thanks in advance!
I am saving a sheet X in a new Workbook using a looping, calculate... as:
I use:
wFxFNpdf = is the Fullname I use for my new created PDF file
wFxFNxls = is the Fullname I use for my new created Excel file
My Problem:
The sheet contains a Chart and this chart comes with No Category labels, No Legend (everything else comes OK in my new created PDF file (check this photo) :
While in my new Excel file I get:
So I do not know Whats wrong ??
Why the :
But the PDF shows everything OK, except the chart legend and category labels WHY ??
I am saving a sheet X in a new Workbook using a looping, calculate... as:
- a new workbook containing only 1 Sheet
- a new PDF file (just a replica of the saved excel file, sheet)
I use:
VBA Code:
Dim WKBvba As Workbook: Set WKBvba = ThisWorkbook 'Name of the workbook you are copying from
Workbooks.Add 1 'adds new workbook containing 1 sheet
Dim WKBnew As Workbook: Set WKBnew = ActiveWorkbook
WKBvba.Sheets(wsPtReport).Copy Before:=WKBnew.Sheets(1)
WKBnew.Sheets(2).Delete
ActiveSheet.Calculate 'In case...
Cells.Copy
Cells.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'I do a few more things, like delete non desired Shapes, named ranges etc...
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=wFxFNpdf, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
If WKBnew.Sheets.Count <> WKBvba.Sheets.Count Then 'My model contains many sheets, the Worksheet, only 1, this is why I use this as Stop any crash (a way to stop saving my model with a new name)..
WKBnew.SaveAs Filename:=wFxFNxls, FileFormat:=xlWorkbookDefault
WKBnew.Close False
End If
wFxFNxls = is the Fullname I use for my new created Excel file
My Problem:
The sheet contains a Chart and this chart comes with No Category labels, No Legend (everything else comes OK in my new created PDF file (check this photo) :
While in my new Excel file I get:
So I do not know Whats wrong ??
Why the :
- Category labels comes Black
- Legend comes Black 'this Legend has No Formula
But the PDF shows everything OK, except the chart legend and category labels WHY ??