Excel Print Button

lzweifel

Board Regular
Joined
Feb 21, 2006
Messages
213
Hi All,

Thank you all for what you do here on MrExcel to help us "not so expert" excel users. From time to time I get in my head something I want to do and sometimes it isn't possible, however I will bash the problem over and over and over again until I come up with the perfect solution... so I am hoping someone out there may have a solution for me.

I have created a template for some "non excel" users where they can enter in some Invoice information that will then calculate out taxes and discounts for them, I have locked cells so that they are only able to enter in their own information and cannot mess with any formulas and such.

By NO means should this excel sheet be sent or opened by anyone else other than the user, therefore I would really like to make a button for print or save which will save as a PDF. What I found, that may work perfectly, was the preview button within the Layout Tab which opens the entire sheet up in a PDF format. So I tried to create a macro and attach it to a button labeled "Print" which would open the sheet in PDF where the user could then print or save. However, I am working on a Mac (I know, I know) and I am getting errors. I only did this by recording a macro. Maybe I am hoping someone could run a script for me that would flawlessly work on any computer (windows or mac)

Thanks a bunch, I truly do appreciate!

L
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
<NamedWorksheet>.PrintOut ActivePrinter:=nPtr, Copies:=1 'Print Sheet
 
Upvote 0
Opps forgot that was using a combo box which auto populates with all printers on the system...
If you want more of that code let me know but the above should get you started. Can just attach to button.
 
Upvote 0
Thank you for your response, however unfortunately I do not quite understand what to do.

I do not want the button to actually print, just bring up the preview as PDF will be good enough, from there the user can save as PDF or print to whatever printer they have on their system... When I go to Layout Tab and choose "Preview" it brings my sheet up with Adobe PDF... this is what I am looking for. Using a button right from excel will help eliminate the question as to how to print or save as PDF.

THANKS A BUNCH!!!! :)
 
Upvote 0
Application.Dialogs (xlDialogPrintPreview) .Show

This?
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,720
Members
448,986
Latest member
andreguerra

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