I was surprised to see this, Ive just never had a project with a only single, non-modal form to show onscreen.
If run from the IDE, all runs well, it shows on screen, the acFocus Control allows access to the text box, etc, and closes when asked.
But when the project is run from another macro (a lisp that calls a VBA Loader), the form shows onscreen and instantly blinks back off. "SHOW 1" works, of course, but then there is no interactivity.
Am I missing something basic here?
Code:
;------------------------------------------------------------------------------
;first, the lisp that defines the command:
; define launcher to search sheet sets for view names
(defun c:ssfind ()
(setvar "cmdecho" 0)
(VL-VBARUN "SearchSheetSets")
(setvar "cmdecho" 1)
(princ)
)
;-----------------------------------------------------------------------------
' now the routine, in a separate VBA Project, that I use to load, then unload, VBA Projects. Ive pasted the Constants from the top of the module next to the Subroutine, for brevity...
Code:
'--------------------------------------------------------------------------------------------
Private Const BASE_UTIL_DIR As String = "X:\Tools\_Utils\"
Private Const SS_FIND_FILENAME = "Sheet_Set_Find.dvb"
Private Const SS_FIND_START_ROUTINE = "modStart_Find_Main.StartFindMain"
Sub SearchSheetSets()
' call routine to serach sheet sets
Dim FileName As String
FileName = BASE_UTIL_DIR & SS_FIND_FILENAME
' Load a sample VBA project DVB file
LoadDVB FileName
' Run the referenced macro
RunMacro SS_FIND_START_ROUTINE
' Unload the VBA project DVB file now.
UnloadDVB FileName
End Sub
'-------------------------------------------------
and in the Sheet set search project, it calls a routine in a code module, that loads the form...
Code:
Sub StartFindMain()
frmSearch.Show
End Sub
I've used this method on all my utils, and havent had a problem until the non modal form.
Anyone know a way around this?