Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook that displays a non modal user form when the workbook is
opened. The user form contains a bunch of buttons for running a number of different macros. After one of the macros runs I want to move focus from the user form back to the worksheet. I have been using the following statement to do this: AppActivate ActiveWorkbook.Windows(1).Caption This works much of the time but occasionally it fails with an invalid argument error message. I have no idea what causes the statement to stop working or begin working again shortly after it has been failing. When the problem is occurring stopping and restarting Excel does not fix the problem. The problem occurs when the workbook is the only one open in Excel. I also know that the value of the caption field is correct from looking at it while in debug. Sometimes just waiting a few minutes makes the problem go away. Two questions: 1. Anyone have an idea as to what would cause the appactivate statement to start failing or working again? 2. Is there a better way to move focus from a non modal user form back to the worksheet? Thanks for your help, Mike Clemens |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
set focus on user form | Excel Programming | |||
User Form focus | Excel Programming | |||
Modeless User Form and Worksheet Focus | Excel Programming | |||
Modal User Form | Excel Programming | |||
Text Box on User Form Set Focus Issue | Excel Programming |