So I have a strange problem:
My macro exports 2 PDF files to a specific folder and they look perfect on the screen!
However, when I print them the graph looks different. I'll display a picture of "right and wrong" below along with my code.
BONUS POINTS!!!
I also have a problem when printing this graph from excel (by selecting print area and clicking print). I've attached that picture as well (It shades under the curve).
But when I manually export it to a PDF and Print, it works....
Anyone have any idea why Excel hates me right now?
Thanks,
JK
My macro exports 2 PDF files to a specific folder and they look perfect on the screen!
However, when I print them the graph looks different. I'll display a picture of "right and wrong" below along with my code.
Code:
Function GetFolder(strPath As String) As String
Dim fldr As FileDialog
Dim sItem As String
Set fldr = Application.FileDialog(msoFileDialogFolderPicker)
With fldr
.Title = "Select a Folder"
.AllowMultiSelect = False
.InitialFileName = strPath
If .Show <> -1 Then GoTo NextCode
sItem = .SelectedItems(1)
End With
NextCode:
GetFolder = sItem
Set fldr = Nothing
End Function
Sub PrintToFile()
Dim fp As String
Dim Active As Worksheet
Dim path As String
Dim filename As String
'Uses GetFolder Function to open file browser
Worksheets("GraphData").Range("R2").FormulaR1C1 = GetFolder("C:\TEST_INITIAL\")
path = Worksheets("GraphData").Range("R2")
filename = Worksheets("GraphData").Range("R3")
fp = path & "\" & filename
'Print Trajectory
Sheets("GraphData").Activate
ActiveSheet.PageSetup.PrintArea = "$K$7:$Z$49"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:=fp, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
'Print Well Bore
filenametwo = Worksheets("GraphData").Range("R4")
fpp = path & "\" & filenametwo
Sheets("GraphData").Activate
ActiveSheet.PageSetup.PrintArea = "$J$51:$AA$95"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, filename:=fpp, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
End Sub
BONUS POINTS!!!
I also have a problem when printing this graph from excel (by selecting print area and clicking print). I've attached that picture as well (It shades under the curve).
But when I manually export it to a PDF and Print, it works....
Anyone have any idea why Excel hates me right now?
Thanks,
JK