Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Hi
I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
And you're sure your in the userform module?
My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Are you sure you have your code in the UserForm's code window?
Rick "Sam Kuo" wrote in message ... Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Hi Dave
1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Hi Rick
Yes the code is in the UserForm's code window. (i.e. I've double checked by right-clicking on the form and select View Code. The UserForm's code window then opens). There is no "UserForm" in the lefthand side object dropdown for me to select from so I don't think it's my typo either. Why is the UserForm not recognized by Excel now, but it was before? Sam "Rick Rothstein (MVP - VB)" wrote: Are you sure you have your code in the UserForm's code window? Rick "Sam Kuo" wrote in message ... Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Since that situation should not exist, it sounds to me like your file may be
corrupted. Before trying what I am about to suggest, wait to see what others say about your problem (they may actually have a good answer for you). Okay, you have been warned. I'm not sure if this will work or not, but what I would do is copy all the code from the UserForm and store it in a Notepad text file, then I would close the UserForm, then close Excel (maybe reboot the computer just in case), restart Excel, add a UserForm and copy all the code you saved back into its code window. Hopefully Excel won't *insist* that the UserForm already exists and everything will be straightened out. Rick "Sam Kuo" wrote in message ... Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
If you add another userform to the same workbook's project, do you see
everything ok? I've seen situations where worksheets seem to have ghosts inside the VBE. The worksheet is deleted, but it looks like it's still there in the VBE. I've never seen this with userforms, though. Sam Kuo wrote: Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson -- Dave Peterson |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Now that I think about this, I'm not sure I remembered correctly.
Sometimes, if you close a workbook, that workbook's project looks like it's still open inside the VBE. Dave Peterson wrote: If you add another userform to the same workbook's project, do you see everything ok? I've seen situations where worksheets seem to have ghosts inside the VBE. The worksheet is deleted, but it looks like it's still there in the VBE. I've never seen this with userforms, though. Sam Kuo wrote: Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
I add another userform as you said, and "UserForm" appears in the righthand
side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... "Dave Peterson" wrote: If you add another userform to the same workbook's project, do you see everything ok? I've seen situations where worksheets seem to have ghosts inside the VBE. The worksheet is deleted, but it looks like it's still there in the VBE. I've never seen this with userforms, though. Sam Kuo wrote: Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson -- Dave Peterson |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
On Sun, 3 Aug 2008 20:36:17 -0700, Sam Kuo
wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... Here's what I do when things get whacky http://www.appspro.com/Utilities/CodeCleaner.htm -- Dick Kusleika Microsoft MVP-Excel http://www.dailydoseofexcel.com |
#11
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Hi Dick
Thanks for your suggestion, but unfortunately the problem doesn't go away after running your Clean Project tool (UserForm itself is still not recognized in VBE)..sigh... "Dick Kusleika" wrote: On Sun, 3 Aug 2008 20:36:17 -0700, Sam Kuo wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... Here's what I do when things get whacky http://www.appspro.com/Utilities/CodeCleaner.htm -- Dick Kusleika Microsoft MVP-Excel http://www.dailydoseofexcel.com |
#12
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
If you want to send the workbook to me I can take a look.
-- Tim Zych www.higherdata.com Compare data in Excel and find differences with Workbook Compare A free, powerful, flexible Excel utility Now with Table Compare for quick table comparisons "Sam Kuo" wrote in message ... Hi Dick Thanks for your suggestion, but unfortunately the problem doesn't go away after running your Clean Project tool (UserForm itself is still not recognized in VBE)..sigh... "Dick Kusleika" wrote: On Sun, 3 Aug 2008 20:36:17 -0700, Sam Kuo wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... Here's what I do when things get whacky http://www.appspro.com/Utilities/CodeCleaner.htm -- Dick Kusleika Microsoft MVP-Excel http://www.dailydoseofexcel.com |
#13
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Another thing to try against a copy of the troublesome workbook.
Start a new workbook (just a temporary workbook). Open a copy of that troublesome workbook. Go into the VBE. Show the project explorer (ctrl-r if it isn't visible) Drag the userform from the troublesome workbook project to the temporary workbook project. Does it work ok there? If yes, try deleting the old userform in the troublesome workbook project. Drag the userform from the temporary workbook project back to the original workbook project. Does it work ok there? If yes, save the copy and use that instead. Sam Kuo wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... "Dave Peterson" wrote: If you add another userform to the same workbook's project, do you see everything ok? I've seen situations where worksheets seem to have ghosts inside the VBE. The worksheet is deleted, but it looks like it's still there in the VBE. I've never seen this with userforms, though. Sam Kuo wrote: Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#14
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Yes, that worked! Thanks!
"Dave Peterson" wrote: Another thing to try against a copy of the troublesome workbook. Start a new workbook (just a temporary workbook). Open a copy of that troublesome workbook. Go into the VBE. Show the project explorer (ctrl-r if it isn't visible) Drag the userform from the troublesome workbook project to the temporary workbook project. Does it work ok there? If yes, try deleting the old userform in the troublesome workbook project. Drag the userform from the temporary workbook project back to the original workbook project. Does it work ok there? If yes, save the copy and use that instead. Sam Kuo wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... "Dave Peterson" wrote: If you add another userform to the same workbook's project, do you see everything ok? I've seen situations where worksheets seem to have ghosts inside the VBE. The worksheet is deleted, but it looks like it's still there in the VBE. I've never seen this with userforms, though. Sam Kuo wrote: Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson -- Dave Peterson -- Dave Peterson |
#15
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
Hi Tim
I saw Dave Peterson's reply below while getting the workbook ready to send to you. So I tried his suggestion and it solves the problem! But thanks for your kind offer to help :-) Sam "Tim Zych" wrote: If you want to send the workbook to me I can take a look. -- Tim Zych www.higherdata.com Compare data in Excel and find differences with Workbook Compare A free, powerful, flexible Excel utility Now with Table Compare for quick table comparisons "Sam Kuo" wrote in message ... Hi Dick Thanks for your suggestion, but unfortunately the problem doesn't go away after running your Clean Project tool (UserForm itself is still not recognized in VBE)..sigh... "Dick Kusleika" wrote: On Sun, 3 Aug 2008 20:36:17 -0700, Sam Kuo wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... Here's what I do when things get whacky http://www.appspro.com/Utilities/CodeCleaner.htm -- Dick Kusleika Microsoft MVP-Excel http://www.dailydoseofexcel.com |
#16
Posted to microsoft.public.excel.programming
|
|||
|
|||
UserForm_Initialize is not recognized??
It doesn't explain what went wrong, but glad it worked.
If I were you, I'd keep a backup of that file--just in case something else strange starts happening. You may be able to retrieve stuff from the backup if you need to. Sam Kuo wrote: Yes, that worked! Thanks! "Dave Peterson" wrote: Another thing to try against a copy of the troublesome workbook. Start a new workbook (just a temporary workbook). Open a copy of that troublesome workbook. Go into the VBE. Show the project explorer (ctrl-r if it isn't visible) Drag the userform from the troublesome workbook project to the temporary workbook project. Does it work ok there? If yes, try deleting the old userform in the troublesome workbook project. Drag the userform from the temporary workbook project back to the original workbook project. Does it work ok there? If yes, save the copy and use that instead. Sam Kuo wrote: I add another userform as you said, and "UserForm" appears in the righthand side dropdown of the new userform's code window alright. However, the event procudures of all controls in the old userform still works fine. It's only the old userform that cannot be recognized in the VBE. I wish there is a solution to this problem, as the last thing I want to do is to retrieve from backup and re-do all the changes I've made... "Dave Peterson" wrote: If you add another userform to the same workbook's project, do you see everything ok? I've seen situations where worksheets seem to have ghosts inside the VBE. The worksheet is deleted, but it looks like it's still there in the VBE. I've never seen this with userforms, though. Sam Kuo wrote: Hi Dave 1) Yes, the code is in the userform module as before when it was still working. 2) There is no "UserForm" for me to select from the lefthand side dropdown. But the form does exists! So I'm really lost now...Any idea? Sam "Dave Peterson" wrote: And you're sure your in the userform module? My second guess is that even though you typed in the correct spelling in your post, you have a typo in your actual code. I'd change the lefthand side dropdown to Userform and then choose Initialize from the righthand side. Maybe you'll see the typo--or just delete the line with the typo and move the generated line to where it belongs. Sam Kuo wrote: Hi I have one form and an event procedure UserForm_Initialize(). This event procedure was working fine before, but somehow Excel doesn't seem to recognize the form now (i.e. when I put the cursor within that event procedure, the object dropdown in the top middle of VB window now shows "(General)", and "Userform_Initialize" in the event dropdown in the top left) Please help me!! Sam -- Dave Peterson -- Dave Peterson -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UserForm_Initialize | Excel Programming | |||
UserForm_Initialize | Excel Programming | |||
UserForm_Initialize() | Excel Programming | |||
UserForm_Initialize | Excel Programming | |||
UserForm_Initialize? How to update. | Excel Programming |