I checked the security and the sheets are not secured. The sheet isn't
activated until it's ready to write the data from the form to the sheet, and
there's a button for that. I did go ahead and activate the sheet but it
didn't make a difference. I really appreciate all of your input. I'll not
try to give up hope if you hang in there with me, okay?
Is there another way to communicate with you other than a public post?
Jim Thomlinson said:
Also check to ensure that the sheets are visible. That could cause some
difficulty if they are not...
HTH
Audrey said:
Hi Jim, it contains some confidential information. It's a form that
collects data and posts it on the spreadsheet. There are a couple of buttons
on it that bring up other forms (just informational forms). It does have two
initialize statements...
Private Sub UserForm_Initialize()
(lots of code [the contents for the combo boxes are hard coded])
End Sub
and this one...
Private Sub ClearForm_Click()
Call UserForm_Initialize
End Sub
Does that help?
:
Does userform2 have any on activate or initialize code. If so can you post
it. Maybe there is something in there...
:
I do, I really do. I've got...
UserForm1
UserForm2
UserForm3
UserForm4
UserForm5
UserForm6
And UserForm2 used to load just fine but now it doesn't. They way I've got
the form, if I get an error message like this, the spreadsheet is already
hidden and then when I debug or cancel out of the error message the form goes
away, too. I have to go into Task Manager to close Excel. Don't feel silly
about the question - I feel really dumb right now!!!
:
Here is a silly question. Do you have a userform2. In the project window you
will see the Excel sheets, the forms and the modules. Under forms is there a
UserForm2?
:
Our keyboards must not match. F9 is something else (I have XP). I added a
"watch" and received the following information back...
Expression: UserForm2
Value: <Object variable or With block variable not set>
Type: UserForm2
Context: Module1.Button2_Click
:
Lets try this from a different angle. In the code window, place your cursor
on the userform2.show line. Hit F9. The line should now be Dark Red. This is
a break point. (When we have figured out what is wrong we can remove the
break point in the exact same way as we placed it in the first place.) Now go
back to excel and press the command button. The code will stop on this break
point. Now hit F8. Keep hitting F8 until an error message appears. Let me
know how it goes.
HTH
:
When I press F8 it tries to save.
:
There is nothing on this line that should cause a problem. Place your cursor
on this line a press F8. This will run your code one line at a time. Keep
pressing F8 until the error message appears. I am guessing that the actual
error might be in a form intialize or form activate event. Give it a try and
let us know how it went...
HTH
:
I've got a macro on a spreadsheet that launches a form but the form wont
open. It has worked for me in the past. I made some minor changes to the
form and the code but now it wont open. When I click on debug here is where
it points...
Sub Button2_Click()
UserForm2.Show this is yellow
End Sub
Any suggestions? I really appreciate your help!!!