ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sendkeys issue (https://www.excelbanter.com/excel-programming/326755-sendkeys-issue.html)

Michael Malinsky[_2_]

Sendkeys issue
 
I have some code I'm running to change printer properties. I've
successfully been able to change the needed properties, but only works
for the currently selected sheet. I tried running a loop such as:

For each sh in Worksheets
sh.Activate
Application.SendKeys {"%fu")

Jim Thomlinson[_3_]

Sendkeys issue
 
You can try adding a DoEvents line immediately after the sendkeys line. This
might help. I have not tested it but that is what I would try first.

"Michael Malinsky" wrote:

I have some code I'm running to change printer properties. I've
successfully been able to change the needed properties, but only works
for the currently selected sheet. I tried running a loop such as:

For each sh in Worksheets
sh.Activate
Application.SendKeys {"%fu")
.
.
.
Next sh

but it first loops through activating each sheet before executing any
of the SendKeys statements.

From what I've read in the NGs, SendKeys can be messy, but I don't seem

have another option. Any ideas?

Thanks,
Mike.



Michael Malinsky[_2_]

Sendkeys issue
 
I actually had to sandwich the sendkeys stuff between two DoEvents, but
it works. Thanks!



All times are GMT +1. The time now is 08:01 AM.

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