ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   new error when try to load userform (https://www.excelbanter.com/excel-programming/286510-new-error-when-try-load-userform.html)

izchk shtifman

new error when try to load userform
 
dear
expert

i have a project and use "userform1" and so far it's work ok
to day i add some controllers to userform and sub module
and i got an error message
"
run-time error
'2110'
can't move focus to the control because it is invisible,not enabled,o
a type that does not
accept the focus
"
and when i press on button debug the yellow line point on th
command
load userform1
i used this command before and i did not change any thing
except what i explain erlear and the new sub module it's called afte
the userform loaded
i try to "play" with enable and visible but nothing help
i also take another project with the same reference and there(in othe
project) it's work
when i push the button help at error message a blank page appear
and this error message number not found in visual help
could you help me
regard
izchack shtifma

--
Message posted from http://www.ExcelForum.com


Harald Staff

new error when try to load userform
 
Hi Izchack

My guess -seeing your code would be useful : Load is not the same as Show. You can Load a
form and it's still only in RAM, not on screen. And if the form's Initialize code has some
SetFocus job, it will err since there's no focus on an invisible form. So -still guessing-
replace
Userform1.Load
with
Userform1.Show

When tons of code call and rely on eachother then the debugger isn't always of great help.
The problem is deeper down the chain than what Debug displays, as it probably is here.

--
HTH. Best wishes Harald
Followup to newsgroup only please.

"izchk shtifman" wrote in message
...
dear
expert

i have a project and use "userform1" and so far it's work ok
to day i add some controllers to userform and sub module
and i got an error message
"
run-time error
'2110'
can't move focus to the control because it is invisible,not enabled,or
a type that does not
accept the focus
"
and when i press on button debug the yellow line point on the
command
load userform1
i used this command before and i did not change any thing
except what i explain erlear and the new sub module it's called after
the userform loaded
i try to "play" with enable and visible but nothing help
i also take another project with the same reference and there(in other
project) it's work
when i push the button help at error message a blank page appear
and this error message number not found in visual help
could you help me
regard
izchack shtifman


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 08:23 AM.

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