ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Userform.Show after sendkeys (https://www.excelbanter.com/excel-programming/310666-userform-show-after-sendkeys.html)

ryan

Userform.Show after sendkeys
 
I have tried alot of different things including sending this code to
another module after running sendkeys to show my userform with no
success. the simple code below sends paper select commands to a
printer and then shows a userform. for some reason the userform does
not ever show and the code goes bad. do i need to cap off the sendkeys
command before executing more code? what can i do to show a userform
after sendkeys? thanks for your help

Sub print_fast()

SendKeys "^{p}"
SendKeys "%{m}"
SendKeys "HP DesignJet"
SendKeys "%{r}"
SendKeys "{esc}"
SendKeys "{esc}"

PLU_SCREEN.Show

End Sub

Dave Peterson[_3_]

Userform.Show after sendkeys
 
I'm not sure you're ever going to get an answer.

Your printer's dialog is pretty specific and on top of that, Sendkeys is very
rarely used--just because it's very difficult to control.

Any chance you could just show that printer setup dialog?

And sometimes, you can add a new printer (same physical printer) driver that has
all your settings selected.

Then you can change to that printer, do your stuff, and change back.



ryan wrote:

I have tried alot of different things including sending this code to
another module after running sendkeys to show my userform with no
success. the simple code below sends paper select commands to a
printer and then shows a userform. for some reason the userform does
not ever show and the code goes bad. do i need to cap off the sendkeys
command before executing more code? what can i do to show a userform
after sendkeys? thanks for your help

Sub print_fast()

SendKeys "^{p}"
SendKeys "%{m}"
SendKeys "HP DesignJet"
SendKeys "%{r}"
SendKeys "{esc}"
SendKeys "{esc}"

PLU_SCREEN.Show

End Sub


--

Dave Peterson



All times are GMT +1. The time now is 05:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com