I have a workbook developed in Excel 2007 (compatibility mode) that contains Userform4. This form can be displayed (or not) depending in the wishes of the user. What I am trying to do is return focus to the worksheet after the UserForm is displayed.
When the worksheet is activated, I have the following code:
This code is also present in another general module:
As written above, the UserForm displays without errors with Excel 2007. However, running the same workbook in Excel 2000, it generates an error "Runtime error 438 Object doesn't support this property or method".
Now, if I change the code to this:
it runs fine in Excel 2000 but not in Excel 2007; In Excel 2007, I get the error message "Runtime error 5 Invalid procedure call or argument".
I also have this code to be used in the event the user has closed the form and wishes to reopen it:
The above code works in Excel 2007, not in Excel 2000.
Changing the code to:
works in Excel 2000 but not Excel 2007.
Can you tell me if this is simply a compatibility issue or am I missing something in the code that will work with both 2000 and 2007?
Thanks J
Bookmarks