Export all VBA code to PDF

ReignEternal

New Member
Joined
Apr 11, 2021
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Hello all,

I have several dozen Modules with VBA. I have looked through the forums as best as I can to find a resolve. I am trying to export all of my macros to PDF. I must be looking at the wrong posts as they help guide me to export the actual module to .BAS files. I am looking to extract all of the VBA within the modules as well as associating the corresponding module names.

Any help is greatly appreciated.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I imagine there is an off the shelf product available for purchase (got a hint of that on FaceBook, but FB isn't my thing).
bas and cl files are just text files that you can open with Word then convert to pdf if you have to go that route. It would take some work to automate it with code, I'd say.
 
Upvote 0
Curiosity led me to this

About half way down is "Exporting A VBComponent Code Module To A Text File". I imagine that either export as a file (either cls or bas) and find Word code to open and convert to pdf, or export and manage Word from Excel via automation, or don't export - just copy code and dump into Word then SaveAs pdf from Excel.
 
Upvote 0
Why don't you just use Print > Current Project > Microsoft Print to PDF ?
The only downside is that it is printing a blank page (module heading only) for each code window for each sheet.

If I open it in Edge, Printing it to pdf a second time and nominating the pages to print (start at first non-blank page) gives me a cut down version.

1647384214501.png
 
Upvote 0
Solution
Why don't you just use Print > Current Project > Microsoft Print to PDF ?
The only downside is that it is printing a blank page (module heading only) for each code window for each sheet.

If I open it in Edge, Printing it to pdf a second time and nominating the pages to print (start at first non-blank page) gives me a cut down version.

View attachment 60158
That is exactly what I was looking for. My mistake was I kept selecting the "Print to file". Thank you for this.
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,411
Members
449,449
Latest member
Quiet_Nectarine_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top