ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Transferring Control From VBA Form to Spreadsheet (https://www.excelbanter.com/excel-programming/377173-transferring-control-vba-form-spreadsheet.html)

Tony LeGrand

Transferring Control From VBA Form to Spreadsheet
 

Can someone explain how to transfer control (focus) to the Exce
Spreadsheet
temporarily, while continuing to have a VBA Form running in th
background?

In Visual Basic I used to do this with the SetWindowPos function foun
in
the Windows "user32" API.

In VBA I don't know how to address window handles and keep my VBA Form
running. I am forced to exit my VBA code entirely if I want to d
anything
in the Excel form itself.

Thank

--
Tony LeGran
-----------------------------------------------------------------------
Tony LeGrand's Profile: http://www.officehelp.in/member.php?userid=504
View this thread: http://www.officehelp.in/showthread.php?t=125710

Posted from - http://www.officehelp.i


NickHK

Transferring Control From VBA Form to Spreadsheet
 
Depends how you are showing your userform. Make sure you show it modeless
Userform1.show vbmodeless

Then you can interact with the spread normally, whilst the userform is
showing.
If you are showing if modal, then you will have to hide it before you can
interact with the spreadsheet.

NickHK

"Tony LeGrand" wrote in message
...

Can someone explain how to transfer control (focus) to the Excel
Spreadsheet
temporarily, while continuing to have a VBA Form running in the
background?

In Visual Basic I used to do this with the SetWindowPos function found
in
the Windows "user32" API.

In VBA I don't know how to address window handles and keep my VBA Form
running. I am forced to exit my VBA code entirely if I want to do
anything
in the Excel form itself.

Thanks


--
Tony LeGrand
------------------------------------------------------------------------
Tony LeGrand's Profile: http://www.officehelp.in/member.php?userid=5042
View this thread: http://www.officehelp.in/showthread.php?t=1257106

Posted from - http://www.officehelp.in




Tony LeGrand[_2_]

Transferring Control From VBA Form to Spreadsheet
 

Thankyou Nick.

Exactly what I needed

--
Tony LeGran
-----------------------------------------------------------------------
Tony LeGrand's Profile: http://www.officehelp.in/member.php?userid=504
View this thread: http://www.officehelp.in/showthread.php?t=125710

Posted from - http://www.officehelp.i



All times are GMT +1. The time now is 06:32 PM.

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