mladenjevtic
New Member
- Joined
- May 23, 2018
- Messages
- 12
I wasn't able to think of the better title for my problem here.
What's going on is that i'm unable to reproduce the same export to PDF from home connection as to my office connection. We use cloud system at the office and use Citrix to connect, so in theory i should have my Windows profile settings the same, wherever i connect.
I have one macro (part of another macro) which creates bunch of PDFs using the code
What i don't understand is:
When i am at the office and run the macro, all PDF files are exported with really large paper sizes. When i open the exported PDF it shows that actual size is 41.77 x 29.51 inches, while i need it to be 8.26 x 11.69 inches (A4 size). But, when i log in to my account from home, and run the very same macro, it exports out just fine to PDF as A4 paper size.
I'm trying to fix the problem on all sort of ways, but i'm not able to find the solution. Question that was answered already on the link: wrong PDF output size with ExportAsFixedFormat in Excel VBA, didn't help me unfortunately. I've read bunch of forums, blogs, tutorials where i can't find why is this happening.
What can i do to reproduce the same result that i get when i log in from home?
What's going on is that i'm unable to reproduce the same export to PDF from home connection as to my office connection. We use cloud system at the office and use Citrix to connect, so in theory i should have my Windows profile settings the same, wherever i connect.
I have one macro (part of another macro) which creates bunch of PDFs using the code
VBA Code:
Public Sub ExportToPDF()
Application.StatusBar = "Printing " & ServiceOrder & " Freight Charges (" & i - 1 & " out of " & LRServiceOrders - 1 & ")"
ICAO = WorksheetFunction.VLookup(Val(ServiceOrder), shRETO.Range("TRETO"), 4, 0)
FileNamePDF = ServiceOrder & Space(1) & ICAO & " Freight charges" & ".pdf"
FolderPDF = shStart.Range("FolderPDF").Value2
shImport.Visible = xlSheetVisible
shImport.PageSetup.PrintArea = shImport.Range("A1:AF" & Rows.Count).End(xlUp)
shImport.ExportAsFixedFormat Type:=xlTypePDF, Filename:=FolderPDF & Application.PathSeparator & FileNamePDF, _
quality:=xlQualityStandard, openafterpublish:=False, IgnorePrintAreas:=False
End Sub
What i don't understand is:
When i am at the office and run the macro, all PDF files are exported with really large paper sizes. When i open the exported PDF it shows that actual size is 41.77 x 29.51 inches, while i need it to be 8.26 x 11.69 inches (A4 size). But, when i log in to my account from home, and run the very same macro, it exports out just fine to PDF as A4 paper size.
I'm trying to fix the problem on all sort of ways, but i'm not able to find the solution. Question that was answered already on the link: wrong PDF output size with ExportAsFixedFormat in Excel VBA, didn't help me unfortunately. I've read bunch of forums, blogs, tutorials where i can't find why is this happening.
What can i do to reproduce the same result that i get when i log in from home?