MsgBox repeated two times (Excel COM Add-in)

  • Thread starter Maurizio BELLANTONE
  • Start date
M

Maurizio BELLANTONE

Dear Sirs,
in my Excel COM Add-in, written in VB6 SP6 (Office 2003) a routine show a
form (FormPwd) in order to permit users to enter a password.
When user enter password and press OK button, FormPwd appair again (without
any apparent reason).
There is an error in my code ?
TIA,
Maurizio Bellantone

Below code I extract form my add-in:

Sub Mask_Passwd()
' Call password request form
FormPwd.TextPwd.Text = ""
FormPwd.Show vbModal 'vbModal
End Sub
'
' FormPwd code
'
Private Sub ButPwdOk_Click()
Dim i As Integer, sB As String

pwd = TextPwd.Text
sB = GetProtectPwd()
msg$ = "Wrong Password!!!"
If pwd = sB Then
Call DisabilitaProtezione
Else
i% = MsgBox(msg$, vbExclamation)
End If
FormPwd.Hide
End Sub
Private Sub ButPwdEsc_Click()
FormPwd.Hide
End Sub
'
' DisabilitaProtezione enable/disable some excel sheets and Visible property
of some excel sheets
'

=========================================================
BELLANTONE MAURIZIO - Teacher, IT Consultant, Programmer
SPINETTA MARENGO (AL) - ITALY
 
M

Madhan

Hi, in my opinion, if the entered password matches the stored password you
call DisabilitaProtezione, but you have not hidden FormPwd. Hence, the
FormPwd will still be in the background when DisabilitaProtezione is
executing and after it has finished execution, it will once-again show the
FormPwd.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top