Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
To All,
Getting a runtime error # 424 on Closing of a USERFORM. I'm trying to set a cell on the worksheet - which contains the CmdButton that launched the UserForm. But my attempts to reference the cell fail? Could someone kindly instruct me how to set this up properly? Thanks ... JimP ''''''''''''''''''''''''''''''' ' TRIED TO DO THIS FIRST .... Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) If CloseMode < vbFormControlMenu Then Cancel = False ' SYSTEM requested to close FORM, so set my flag! [frmNAVIGATE_Run_flag].Value = 1 'PROBLEM ON THIS LINE Else Cancel = True: QuitButton_Click ' CANCEL QueryClose ... do what I need End If End Sub ''''''''''''''''''''''''''''''' ' TRIED THIS SECOND ... Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer) Dim ws As Worksheet: Set ws = Sheets(ActiveSheet.name) If CloseMode < vbFormControlMenu Then Cancel = False ' SYSTEM requested to close FORM, so set my flag! ws.[frmNAVIGATE_Run_flag].Value = 1 'PROBLEM ON THIS LINE Else Cancel = True: QuitButton_Click ' CANCEL QueryClose ... do what I need End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error code 1004 | Excel Worksheet Functions | |||
Runtime error '1004' General ODBC error | New Users to Excel | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Repost with code - Runtime error '1004' | Excel Programming | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |