View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
NickHK NickHK is offline
external usenet poster
 
Posts: 4,391
Default Odd UserForm Behavior

Gene,
For one thing, if you have just .Saved the WB and not made any further
changes, you should not get that warning.
What do you get for Thisworkbook.saved=true ?
Or if you loop through all workbooks checking their .saved property ?
If one of them is False, it would seem you are interacting with some
unexpected WB.

Apart from that, what does UpdateProgress do ?

NickHK

"Gene" wrote in message
...
Nick,

Thanks for the reply. I have been at it most of the night.

Here is the original Workbook_Open
Sub Workbook_Open()
removerandc
QWiz.MultiPage1.Value = 0
QWiz.settips
QWiz.UpdateProgress
QWiz.Show
restorerandc
End Sub

I think the version I pasted in earlier had some of my troubleshooting
changes in it. Sorry.


Here is the workbook save button:
Private Sub Savebtn_Click()
UpdateProgress
ActiveWorkbook.Save
exitsurvey = MsgBox("Exit Survey?", vbYesNo, "UAS Evaluation progress

saved.
Exit Survey?")
If exitsurvey = 6 Then
Application.DisplayAlerts = False
restorerandc
Application.Quit
End If
End Sub

removerandc & restorerandc are just removing and restoring toolbars etc.
The Application.DisplayAlerts = False is to suppress the alert box when
closing the application to save the worksheet again.

I commented out the DisplayAlerts and just got the same alert box asking

me
if I wanted to save the worksheet. I clicked yes and when I reopened
it...same problem. :(

--
Gene


"NickHK" wrote:

Gene,
My first thought would be remove the Application.DisplayAlerts = False,

so
you can see if Excel is trying to tell you something.
Also, you Unloading the userform in the Savebtn_Click event and then

again
after QWiz.Show.
Do you really want to close Excel every time this file is used ?

NickHK
P.S. You can use vbYes in place of 6. It more clear what you mean.

"Gene" wrote in message
...
I've created a userform to gather question responses and save them to

a
spreadsheet. I made a "Save" button which saves the spreadsheet and

then
asks if the user wants to quit. The user form is unloaded and the
application quits.

For some reason, when the user returns to the form, to continue

entering
in
data, Excel locks up after 1 or 2 items entered.

here is the workbook open code:
Sub Workbook_Open()
removerandc
QWiz.MultiPage1.Value = 0
QWiz.settips
QWiz.UpdateProgress
QWiz.Show
Unload QWiz
restorerandc
Application.Quit
End Sub

and here is the save button code:
Private Sub Savebtn_Click()
UpdateProgress
ActiveWorkbook.Save
exitsurvey = MsgBox("UAS Evaluation progress saved. Exit Survey?",

vbYesNo,
"Exit Survey?")
If exitsurvey = 6 Then
Application.DisplayAlerts = False
Unload QWiz
End If
End Sub
--

I am truly stumped. Any ideas would be great.

Thanks,
Gene