Oct 10 2020 08:17 AM
Hello. Using VBA for Excel (Office365), how can I print an Excel worksheet to PDF, while scaling to fit all columns to a single page wide? In my VBA script, I have already set: `FitToPagesWide = 1`. Here is more information.
For the past few years I've used Office 2013, and with it, a particular VBA for Excel script which would print a worksheet to PDF, while scaling to fit all columns to a single page wide. I recently updated to Office365 and the same VBA script is now printing to PDF, but not scaling to fit all columns to a single page wide. Any ideas why that is occurring and how to resolve it?
See this Pastebin for my VBA function.
Thanks in advance.
Oct 10 2020 09:24 AM
As far as I had to learn here...
(This information without guarantee, I would be happy to be instructed if it could work.
MS changes, develops and refines its products so well and quickly that you can hardly keep up with them. They are that good! :).
Click the Link for more info about this issue, Please:
This feature is not available in Excel for the web.
If you have the Excel desktop application, you can use the Open in Excel button to open the workbook and scale the worksheet to fit data on one page.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
Oct 10 2020 09:31 AM
@NikolinoDE Thanks for the reply. I had a look at that link. Unless I'm missing something though, it describes how to print using the GUI provided by the Excel application. I'm asking how to print using VBA for Excel. Did I miss that information somewhere in the link you provided?
Oct 10 2020 09:53 AM
All versions of Office 365 will allow execution and creation of Macros, it is only the free online version that will not.
Mean with it, only MicrosoftOffice 365 (browser version) does not support VBA macros.
I hope that with this information I was able to help you in any way.
Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
Oct 10 2020 09:56 AM
@NikolinoDE I appreciate the reply, but those links aren't giving me any helpful information for my question. I'm asking for specific help on why my VBA code isn't doing what I expect.
Oct 10 2020 10:21 AM
In order not to be misunderstood, the goal of some Excel users in the community is to provide help with projects by Excel users, or rather to provide food for thought.
As part of this excellent forum, my aim is to give help to get help where I can and need it.
That's why I try (like some others here) to help voluntarily as far as I can.
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
VerzeichnisName & "\" & Name, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=True
With ActiveSheet.PageSetup
.Zoom = False
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
'Check your code to see if you have used zoom correctly.
'Is just a suggestion doesn't have to be right ...
'because I know that I don't know anything.
The only thing I can do for you is this VBA code.
But since I don't have a 365 Office desktop version (like you, as far as I could see your written version) I can't help you any further.
I think that one of Microsoft will take care of your question.
I'm sure they will give you a specific or official answer.
In the meantime, please be patient, we have weekend :)
Sorry that I took your time and couldn't give you a quick solution.
Wish you a nice day/night.
Nikolino
I know I don't know anything (Socrates)
Dec 03 2020 07:30 AM
Solution@NikolinoDE Sorry for the late reply. Thanks for the help. I was able to resolve the issue in another MS forum (see here).
Dec 03 2020 09:13 AM
I am pleased that you were able to find a solution to your project.
I wish you good luck with Excel.
Thank you for your time and patience
Nikolino
I know I don't know anything (Socrates)
Dec 03 2020 07:30 AM
Solution@NikolinoDE Sorry for the late reply. Thanks for the help. I was able to resolve the issue in another MS forum (see here).