Focus back from modeless userform to sheet

R

RB Smissaert

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
 
R

Ron de Bruin

This must work for example

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

RB Smissaert

It doesn't with me.

RBS


Ron de Bruin said:
This must work for example

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

RB Smissaert

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
 
R

Ron de Bruin

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
 
Top