+ Reply to Thread
Results 1 to 41 of 41

Userform as printer interface for a protected workbook.

  1. #1
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Userform as printer interface for a protected workbook.

    Good evening. I'm closing in on the final stage of a large project and I've run into a road block. The following line of code is preventing my users from being able to select specific page ranges when using the Print Entire Workbook option in the print menu.

    Please Login or Register  to view this content.
    I've attached the latest version of my form (with significant support by jaslake) to help explain what I'm attempting here. The attached form has several macros that activate upon open; including a user form. The password for the workbook/worksheets/VBE is "j".

    I started last night to explore ways a user form might be able to tackle a few issues in my form and I got myself turned all around. Tonight it was suggested to me that a user form might be able to tackle the printer issue I mentioned above.

    So, has anyone ever used a user form as a printer interface and liked the results? Would anyone be willing to steer me in the direction I might go to start coding the user form that would give my users printing options?

    Thanks in advance.

    Matthew
    Attached Files Attached Files
    Last edited by moosetales; 04-21-2014 at 09:46 PM.

  2. #2
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    I was able to piece together a few elements of the userform and have what feels to be a good start. I'm off to work so I'll check in later with a bit more about what I'm hoping for the userform.

    The thing that has me stumped for the moment is the code that transfers the data (date) to Sheet Demographics E14. Back soon.

    Matthew
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    I've spent some more time working on the userform and have attached an updated version of the form.I've got code placed in the userform that triggers the userform to initiate upon open, fills the combobox with the sheet names and exits the userform.

    I'm working on code to do the following:

    1) link OB_HCT and OB_RCS in the userform to Sheet "Demographics" D3:E3 (this will allow the user to select the service name from the drop down list in D3:E3 before entering the form

    2) add code to the print section in the userform to allow the user to print single sided or duplex, select and print individual worksheets or all worksheets at once and to allow the user to print pages 1-4 or 1-5 or 1-3 as they wish

    3) add code to OB_InitialITP, OB_ITPReview and OB_EditITP so the form is ready for the user after they click Start (I'll provide more specifics once I'm to this part of the project)

    4) add code to refresh or clear the userform

    First question:

    Is it possible to code an OB on the userform to select a specific value from a DV list in a worksheet? BTW...When a value is selected directly from the DV list in the worksheet, that selection prompts other cells to auto-populate with specified values.

    Thanks.

    Matthew
    Attached Files Attached Files

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    The answer to this is yes, assuming one knows what a DV is and the location of the DV List and the variablse related to the chosen DV (whatever a DV might happen be).

    Is it possible to code an OB on the userform to select a specific value from a DV list in a worksheet? BTW...When a value is selected directly from the DV list in the worksheet, that selection prompts other cells to auto-populate with specified values.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  5. #5
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Oops....Data Validation. The "list" that I'm referencing is in my form on Sheet "Program". This sheet is hidden when the form is in use. Sorry about the ambiguous terminology.

    This list is what populates Sheet "Demographics" G11, G12, G30, G32 and Sheet "Presenting Problems & Progress" B1 when the user selects a Service Name under "Care & Comfort" on Sheet "Demographics".

    Just when I think I understand the lingo here I'm reminded I've got lots to learn...I'll stick to English from here on out .

    Thanks.

    Matthew

    P.S. Heading home to corral kiddos so I'll be out of pocket for a bit. My oldest skinned a dead Peacock today for a friend in exchange for fly tying materials..yes he's an avid fly fisherman. He's excited to show off the results. Talk soon.

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    Here's a "Start" on your Start Button to deal with this
    Is it possible to code an OB on the userform to select a specific value from a DV list in a worksheet? BTW...When a value is selected directly from the DV list in the worksheet, that selection prompts other cells to auto-populate with specified values.
    NA# will need to be dealt with if neither Option Button 4 nor 6 are True.

    Please Login or Register  to view this content.
    This is a MAJOR roadblock
    print section in the userform to allow the user to print ...duplex

  7. #7
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    I've inserted the code you posted and it works great. I'm not in any way married to the Duplex functionality. In fact, I really like the way the printing is set up now except it does not allow the user to print Entire Workbook AND specify the number of pages they wish to print. I've removed the On/Off OB from the userform.

    I made a couple adjustments to your code to match the names I've given to the Option Buttons and a line of code so the userform closes when the Start button is clicked.

    Please Login or Register  to view this content.
    I'm home now and will keep you posted on my progress. Thanks.

    Matthew
    Attached Files Attached Files

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    I've lost my wireless network and am now hard wired to the cable modem...may be offline for a while until I can get that resolved. Keep truckin'...keep me posted. Get back to you soon as I can.

  9. #9
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Sorry to hear that...with 4 kids and all their wireless devices I can feel your pain. Wireless is great until you don't have it . My coding isn't pretty but I think it's working thus far; if you see something that you believe might be a conflict down the road OR be unstable please by all means throw a suggestion my way.

    Here are my lines of code I have thus far. Pretty much everything is set except for the print features. If my setup for printing was not what you had in mind please let me know.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    I hit a wall! What I believed would be a straight forward fix turned out to be more complicated than I could figure out. Here's what I was trying to do:

    On Sheet ITP Goals & Obj. we have a button titled "ADD OBJECTIVE INDICATOR". One of my users brought it to my attention that the user needs to be able to select the row where they would like the new Objective Indicator to be placed instead of a new row being added to the bottom of the list of Objective Indicators. I looked at the code for the button labled "ADD OBJ" on the same sheet since this button allows the user to select a specific row where they would like to add a new Obj. so I thought I could adapt this code for my purposes.

    Here's the code currently in use for the ADD OBJECTIVE INDICATOR button:

    Please Login or Register  to view this content.
    Here's the code we currently have in place for the ADD OBJ button:

    Please Login or Register  to view this content.
    I'll keep working on it in case I can figure it out but if you have a chance to give me a nudge in the right direction that would be great. Thanks.

    Matthew
    Last edited by moosetales; 04-23-2014 at 07:11 AM.

  11. #11
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Well, you'll be pleased to hear that the first official training, for the launch of the new treatment plan form, just concluded in Bangor, ME. I figured that even though I still have a couple hiccups to work through I needed to set a date and launch. The feedback was positive and other than the coding for the printing function the code performed very well. There were no hiccups or glitches during the roll out.

    My next training is slated for this upcoming Tuesday (Presque Isle, ME) so I have a bit of a breather to iron out the last few coding issues.

    Please know that as of today, there is a group of people in Bangor, ME who know you as "John" and appreciate the work you've done. Thanks.

    Matthew

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew...glad the training went well. I'm installing a new router...get back to this later in the afternoon.

  13. #13
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John, Welcome back (for the moment). I just installed a new one myself a month or so ago. Good luck.

    Matthew

  14. #14
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Not sure what you are thinking about for the print issue but I ran across this and have been playing with it. Before trying alternative solutions (like the link suggests below) I'm interested in what you have planned. Thanks.

    http://spreadsheetpage.com/index.php...eets_to_print/

    Matthew

  15. #15
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    I'm currently having Forum issues. I'm going to work on this issue as I believe it's more complex than the printing issue
    the user needs to be able to select the row where they would like the new Objective Indicator to be placed instead of a new row being added to the bottom of the list of Objective Indicators
    I have several Links I'll post that I believe will resolve the printing issue.

    I hope I don't become "infamous" in Bangor

  16. #16
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    Quote Originally Posted by jaslake View Post
    I hope I don't become "infamous" in Bangor
    Hardly. Maybe famous but definitely not infamous. BTW, have you ever been to ME? Dinner with a view of the ocean is on me if you ever venture our way.

    Matthew

  17. #17
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    Still having Router and Forum issues. Working on your issue(s).

    I don't travel much these days so probably will not get to ME...thanks for the offer. However, should you be in Mid NE Ohio let me know.

  18. #18
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    Try the Code in the attached for this issue
    the user needs to be able to select the row where they would like the new Objective Indicator to be placed
    Attached Files Attached Files

  19. #19
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Welcome back . The code works great. I've tweaked it a bit (for now) to clear content in both columns C & D and have commented out a portion of the code (see below) till I can figure out a way to standardize what my users will enter in Column C.

    Please Login or Register  to view this content.
    I'll work with the code a bit and will be in touch. As always, thanks a ton.

    Matthew

    P.S.
    Check out the "CSR Template" button (lower left corner) on the userform. It's purpose is to allow the users to extract certain pieces of the treatment plan that they will need to copy and paste into other forms that are submitted for insurance re-authorizations. I'm still working on the syntax for copying multiple ranges but it's coming along.
    Attached Files Attached Files

  20. #20
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    Try the UserForm Print Code. Please note, I've commented out the Before Print Code in ThisWorkbook Module and added Module Print_Routines.
    Attached Files Attached Files

  21. #21
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Wow! You out did yourself. I'm just back from a day with kiddos and family and I've had just a few minutes to comb through the code you added/amended and it's impressive. Once my evening winds down and kiddos are tucked in I'll take a closer look and run the code through it's paces. I have a ton of learning to do regarding how all the pieces that you've added fit together. I'll be in touch. My crew will be happy campers for sure.

    Matthew

  22. #22
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    I've had a little time to try out the new code. I won't be able to tell exactly how the print controls work until I'm back in the office and can actually print but from the looks of it things are looking good for a resolution of our print issues. I'll let you know what I find on Monday.

    I'm running into a hiccup with the Show Toolbar and Hide Toolbar command buttons. After printing "All" from the userform my Show and Hide Toolbar buttons do not work until I manually click Esc. Is this the nature of the beast or can this be helped? Thanks.

    Matthew
    Last edited by moosetales; 04-26-2014 at 09:09 AM.

  23. #23
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    In Module 9 comment out the two indicated lines of Code...let me know
    Please Login or Register  to view this content.

  24. #24
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    That took care of Show/Hide Toolbar button issue but I need to do some research to determine why we added the "SendKeys..." line of code in the first place to make sure that commenting it out doesn't affect the reason we originally added it.

    BTW, with the newest lines of code added, is it intended for my users to just use the userform to print or will they be able to print via the userform and the regular print options offered by Excel? The reason I'm asking, I attempted to print a select number of pages (for instance 1-3) using Print Entire Workbook and my buttons in the form disappeared.

    Thanks.

    Matthew
    Last edited by moosetales; 04-26-2014 at 11:36 AM.

  25. #25
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    As I previously mentioned
    Please note, I've commented out the Before Print Code in ThisWorkbook Module and added Module Print_Routines
    It's my opinion you can have either the UserForm Print routines or the native Excel Routines. If a User should use the native Excel Routines by mistake you'll need to provide them with a method to reinstate the Buttons. Since the Buttons have disappeared the Code would have to be called by a Key Board Shortcut.

    For example, assign Refresh_Buttons to the Keyboard Shortcut CTRL + r. Using that combination of Keyboard strokes will run the Refresh_Buttons Code.

    Let me know how you wish to proceed...

    Edit: We added the Send Keys line of Code to fix this exact issue. In playing with the issue I think I found if you don't have this line of Code
    Please Login or Register  to view this content.
    you don't need this line of Code
    ' SendKeys "{ESC}", True '<----Comment out this line of Code
    Last edited by jaslake; 04-26-2014 at 11:49 AM.

  26. #26
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    Let me do a bit of research...perhaps we can not allow the User to print from Native Excel (if that's acceptable). It'll be later today...off to Grandson's Soccer games.

  27. #27
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    Quote Originally Posted by jaslake View Post
    It's my opinion you can have either the UserForm Print routines or the native Excel Routines. If a User should use the native Excel Routines by mistake you'll need to provide them with a method to reinstate the Buttons. Since the Buttons have disappeared the Code would have to be called by a Key Board Shortcut.
    Regarding the above....could the following code be modified to trigger our Refresh Macro when any cell that's unlocked is clicked in to?

    Please Login or Register  to view this content.
    Source: http://superuser.com/questions/66358...-specific-cell

    Matthew

  28. #28
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    For what purpose??? What's the issue???
    trigger our Refresh Macro when any cell that's unlocked is clicked

  29. #29
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Ha, we posted at the same time. Enjoy the game. I'm heading out around 4 to take the kids rock climbing so I'll check back in when we get back.

    Matthew

  30. #30
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    Quote Originally Posted by jaslake View Post
    For what purpose??? What's the issue???
    My thought was that this might allow the user to print either through the userform interface or natively.

    Here's how I envision it.....

    1) the user prints natively
    2) after print cell E9 on Demographics is always selected and once selected maybe we could set the code to automatically call the Refresh_Buttons macro


    Maybe this wouldn't work. I'll do some digging and see what I can find. Thanks. Talk soon.

    Matthew
    Last edited by moosetales; 04-26-2014 at 12:55 PM.

  31. #31
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    If you wish to force the User to only print from the UserForm, add this Code to ThisWorkbook Module
    Please Login or Register  to view this content.
    Replace the Print_Routines Module Code with this
    Please Login or Register  to view this content.

  32. #32
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    This could probably be implemented but the Code will be called ANYTIME the Target Cell is clicked. I'd not recommend it.
    Please Login or Register  to view this content.
    Last edited by jaslake; 04-26-2014 at 12:43 PM.

  33. #33
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Well, I've done some playing with the various ideas listed above and for now I've settled on allowing my users to print using both native and userform controls. I've assigned Ctrl + r to the Refresh_Buttons macro. I've added a pop up message that alerts the user of the need to hit Ctrl = r after printing. I can't figure out how, if possible, to stop the pop up box from appearing when my user prints a single worksheet from the userform.

    Also, how can i have the checkboxes in the print portion of the userform uncheck after the print button is clicked? Thanks.

    Off to the climbing wall. Talk soon.

    Matthew
    Attached Files Attached Files

  34. #34
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    To do this
    how can i have the checkboxes in the print portion of the userform uncheck after the print button is clicked
    Add this Code to the bottom of Private Sub Print_ITP_Click()
    Please Login or Register  to view this content.
    To do this
    stop the pop up box from appearing when my user prints a single worksheet from the userform
    Replace the Private Sub Workbook_BeforePrint Code with this
    Please Login or Register  to view this content.
    and Replace the Print_Routines Module Code with this
    Please Login or Register  to view this content.

  35. #35
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    I just added the code you posted above. I accidentally selected ALL and Demographics at the same time (out of the menu in the userform) and I got a run time error 9 "Subscript out of range". Not sure what this is about.

    Also, now when I print entire workbook from the native print menu I don't see the little popup box in the middle of the screen that quickly appears as the pages are printed. Should I see that popup box still? Thanks.

    Matthew
    Attached Files Attached Files
    Last edited by moosetales; 04-26-2014 at 07:27 PM.

  36. #36
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    I've been pouring over the code you provided for the print functions and I'm just not following the flow. Up to now I've been able follow the code and figure things out, more or less and I want so badly to follow what you've done here. If there's anything you might be able to explain about the flow of the code and/or how it's all connected I would appreciate it. If it's too involved that's okay as well. As always, thanks.

    Matthew

  37. #37
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    I have this fixed
    I accidentally selected ALL and Demographics at the same time (out of the menu in the UserForm) and I got a run time error 9 "Subscript out of range"
    The native Excel 2010 print mode, to me, is squirrelly. If you ONLY want to print the ENTIRE Workbook it works fine.

    You CANNOT print selected Worksheets ( eg: 1,3,5) in native Excel 2010...it's simply not an option...requires Code.

    Supposedly you CAN print sequential Worksheets in native Excel 2010 (eg: 1-3) but I can't make it work on my platform.

    So, I need you to tell me where you wish to go with this. Please let me know what functionality you wish based on the above.

    All functionality is available through the UserForm. Only Entire Workbook, on my platform, is available in native Excel.

    Let me know.

    I'm having terrible response time with the Forum...perhaps router related...don't know...frustrating.

    Edit: I'll be happy to do this...first define functionality you require.
    explain about the flow of the code and/or how it's all connected
    Last edited by jaslake; 04-26-2014 at 09:27 PM.

  38. #38
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    Hey John,

    Sorry about the slow response time from the forum. Hope it clears up for you soon and is only an easy fix. Regarding the printing, realistically, the only two things my users need from the native print options are the ability to specify the printer they wish to print to (unless they are printing to their "default" printer) and the ability to switch between single and duplex printing. The only draw back to printing out the individual worksheets is that the page numbering start over with each worksheet. If I need to I guess I could pull out the page numbering.

    Matthew

  39. #39
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Userform as printer interface for a protected workbook.

    Hi Matthew

    The Code in the attached has been modified and annotated as requested. The Code allows the User to print from Native Excel or from the User Form. This Code below checks to see where the Print Request came from, the User Form or Native Excel. If the Request came from the User Form the Code allows the Print_Routine Code to run. If the Request came from Native Excel the Code runs from the Print Dialog and reminds the User to reset The Buttons (CTRL + r).
    Please Login or Register  to view this content.
    The User Form Print Code has been modified also such that if ALL is selected it ignores any Individual Sheets that have been selected. This avoids the Error you reported
    run time error 9 "Subscript out of range"
    Please Login or Register  to view this content.
    And finally, the Print Routines have been modified. Print All is essentially the same. Print Selection now numbers the Pages.

    Any questions, let me know...
    Please Login or Register  to view this content.
    Attached Files Attached Files

  40. #40
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    Off to the aquarium with the kiddos. You've given me lots to read and pour through when I return. Thanks for the updates AND the comments. Can't wait to get to the office tomorrow and try out the print features.

    Matthew

  41. #41
    Forum Contributor
    Join Date
    02-22-2014
    Location
    Winthrop, ME
    MS-Off Ver
    Excel 2010
    Posts
    420

    Re: Userform as printer interface for a protected workbook.

    John,

    I'm back home in Maine after being away in MA since Thursday. I've had a few minutes to look through the code and I'm grinning from ear to ear. The code is working fantastic. I made a couple tweaks here and there:

    At the end of Private Sub Print_ITP_Click()

    Please Login or Register  to view this content.
    Near the end of Sub Refresh_Buttons()

    Please Login or Register  to view this content.
    As I said before, I will try the code out tomorrow at work and unless something we're not seeing pops up we are looking golden on this form. I've got one more issue I'm trying to figure out the syntax for but it's better addressed in a different thread; I'll PM you the link. Thanks.

    Based on my assessment of the form and how the print features are functioning, I'm going to call this thread SOLVED. As always, thanks a lot....especially for the comments in the newly added code associated with printing.

    Talk soon.

    Matthew
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using an form control combobox on an interface protected workbook
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2013, 12:42 PM
  2. Userform and button to select printer
    By Surreall in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-26-2013, 09:22 AM
  3. [SOLVED] Copy protected sheet to a NEW workbook that is not protected
    By lsteinbach in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2012, 11:50 AM
  4. VBA code to print Userform to specific Printer
    By RossN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 06:03 PM
  5. [SOLVED] Group, Outline, Protected Worksheets and Protected Workbook
    By BEEJAY in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-13-2006, 04:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1