Forum Discussion
VBA for Excel (365), how to print to PDF, while scaling to fit all columns to a single page wide?
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 https://pastebin.com/GrTuCffb for my VBA function.
Thanks in advance.
NikolinoDE Sorry for the late reply. Thanks for the help. I was able to resolve the issue in another MS forum (https://social.msdn.microsoft.com/Forums/lync/en-US/5295c5e4-7517-41f5-a341-99b84035c59a/with-vba-for-excel-office365-how-can-i-print-a-worksheet-to-pdf-while-scaling-to-fit-all-columns?forum=exceldev).
7 Replies
- NikolinoDEPlatinum Contributor
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 patienceNikolino
I know I don't know anything (Socrates) - NikolinoDEPlatinum Contributor
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.
Fit to one page
Excel for Microsoft 365 Excel for the web Excel 2019 Excel 2016 Excel 2013Thank you for your understanding and patience
Nikolino
I know I don't know anything (Socrates)
- cagrossCopper Contributor
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?
- NikolinoDEPlatinum Contributor
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.
Does Office 365 Online version supports VBA(visual basic for applications)?
Work with VBA macros in Excel for the web
Excel for the webEnable or disable macros in Office files
VBA Macros in Excel (office 365)
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)