View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Brettjg Brettjg is offline
external usenet poster
 
Posts: 295
Default ComboBox doing a double take?

I have a ComboBox with a click routine attached to it to perform various
tasks. If I click 'cancel' on the confirm box (from the CALLED macro) then it
comes up again. It doesn't matter whether events are on/off. That's a bit odd
isn't it?


Private Sub ComboBox1_Change()
Application.EnableEvents = False
If ComboBox1.Text = "ACTION LIST" Then: GoTo EXIT_SUB

If ComboBox1.Text = "CREATE NEW CLIENT" Then
ComboBox1.Text = "ACTION LIST"
Range("title.1").Select
Application.Run "PERSONAL.xls!CREATE_NEW_CLIENT", "CREATE NEW CLIENT"
GoTo EXIT_SUB
end if

EXIT_SUB:
Application.EnableEvents = True
End Sub

The routine that is called is:

Sub CREATE_NEW_CLIENT(act)
answer = MsgBox(act, vbOKCancel + vbDefaultButton2, "CONFIRM THE ACTION")
If answer = 2 Then: Exit Sub
Dim fso As Object, SourceFile, DestinationFile
Set fso = CreateObject("scripting.FileSystemObject")
fso.createFolder "C:\1. ACTIVE CLIENTS\" & Range("foldername")
ActiveWorkbook.SaveAs Filename:=Range("Path.IF").Value, CreateBackup:=False
End Sub