Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Focus back from modeless userform to sheet

Using Excel 2002.
I have a modeless userform that I can make pseudo-minimised with code from
the form. It changes the height and width and top and left of the form,
nothing else. After this I want to put the focus in the worksheet.
I have seen many postings about this and they say that:

AppActivate Application.Caption

ActiveCell.Activate

Should do the trick. Unfortunately it doesn't.

Is there any other way to put the focus back in the worksheet?
Thanks for any advice.


RBS

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Focus back from modeless userform to sheet

This must work for example

Sub ShowTheForm()
UserForm1.Show vbModeless
Range("A1").Select
AppActivate Application.Caption
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"RB Smissaert" wrote in message ...
Using Excel 2002.
I have a modeless userform that I can make pseudo-minimised with code from
the form. It changes the height and width and top and left of the form,
nothing else. After this I want to put the focus in the worksheet.
I have seen many postings about this and they say that:

AppActivate Application.Caption

ActiveCell.Activate

Should do the trick. Unfortunately it doesn't.

Is there any other way to put the focus back in the worksheet?
Thanks for any advice.


RBS



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Focus back from modeless userform to sheet

It doesn't with me.

RBS


"Ron de Bruin" wrote in message
...
This must work for example

Sub ShowTheForm()
UserForm1.Show vbModeless
Range("A1").Select
AppActivate Application.Caption
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"RB Smissaert" wrote in message

...
Using Excel 2002.
I have a modeless userform that I can make pseudo-minimised with code

from
the form. It changes the height and width and top and left of the form,
nothing else. After this I want to put the focus in the worksheet.
I have seen many postings about this and they say that:

AppActivate Application.Caption

ActiveCell.Activate

Should do the trick. Unfortunately it doesn't.

Is there any other way to put the focus back in the worksheet?
Thanks for any advice.


RBS




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Focus back from modeless userform to sheet

Ron,

It does work when I run your example in a new Workbook.
I load my form from an add-in and the form is a big, complicated one.
Still I can't see the difference with the simple example.
I have a work-around now with a the API, but I hope it can be done simpler.

Bart


"Ron de Bruin" wrote in message
...
This must work for example

Sub ShowTheForm()
UserForm1.Show vbModeless
Range("A1").Select
AppActivate Application.Caption
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"RB Smissaert" wrote in message

...
Using Excel 2002.
I have a modeless userform that I can make pseudo-minimised with code

from
the form. It changes the height and width and top and left of the form,
nothing else. After this I want to put the focus in the worksheet.
I have seen many postings about this and they say that:

AppActivate Application.Caption

ActiveCell.Activate

Should do the trick. Unfortunately it doesn't.

Is there any other way to put the focus back in the worksheet?
Thanks for any advice.


RBS




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Focus back from modeless userform to sheet

Hi Bart

Still I can't see the difference with the simple example


I try the code in my Google Search Add-in and it is
working correct.

Maybe anybody else have a idea

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"RB Smissaert" wrote in message ...
Ron,

It does work when I run your example in a new Workbook.
I load my form from an add-in and the form is a big, complicated one.
Still I can't see the difference with the simple example.
I have a work-around now with a the API, but I hope it can be done simpler.

Bart


"Ron de Bruin" wrote in message
...
This must work for example

Sub ShowTheForm()
UserForm1.Show vbModeless
Range("A1").Select
AppActivate Application.Caption
End Sub

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"RB Smissaert" wrote in message

...
Using Excel 2002.
I have a modeless userform that I can make pseudo-minimised with code

from
the form. It changes the height and width and top and left of the form,
nothing else. After this I want to put the focus in the worksheet.
I have seen many postings about this and they say that:

AppActivate Application.Caption

ActiveCell.Activate

Should do the trick. Unfortunately it doesn't.

Is there any other way to put the focus back in the worksheet?
Thanks for any advice.


RBS






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modeless userform hngo New Users to Excel 2 July 13th 05 09:23 AM
Hide/Show modeless userform when activating/deactivating workbooks Jeremy Gollehon[_2_] Excel Programming 0 August 28th 03 11:05 PM
Must be a way to force focus back to sheet instead of UserForm - isn't there? Les[_4_] Excel Programming 2 July 29th 03 12:45 PM
How to set focus back to sheet after showing a user form Stephen Bullen Excel Programming 0 July 22nd 03 10:34 AM
How to set focus back to sheet after showing a user form Les[_4_] Excel Programming 0 July 21st 03 07:58 PM


All times are GMT +1. The time now is 05:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"