Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Does anyone know how to close an application that is "not" in the MS Office
Suite? Following is code I used to create a new instance of the object, but can't seem to find the method to close the application: Sub OpenOtherApplication(FilePath, FileName) Dim MMApp As New MindManager.Application Dim FilePathAndName As String FilePathAndName = FilePath & "\" & FileName MMApp.Visible = True MMApp.Documents.Open (FilePathAndName) |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Depends on the app you wan't to close. if it supports VBA (autocad, microstation do) you could use the getobject() to instance the app and close it. if it's not yuo will need api to find it's active window and handle and close the thread (look at allapi.net for info on API) N.B. this will require expoerience in VBA, a bit of VB and API -- Dnereb ------------------------------------------------------------------------ Dnereb's Profile: http://www.excelforum.com/member.php...o&userid=26182 View this thread: http://www.excelforum.com/showthread...hreadid=482975 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dnereb:
My application won't close with GetObject/CreateObject as you suspected. Thanks for your suggestion to explore the API, and the pointer to your site - I'm able to close the app now. Regards, VBA Dabbler "Dnereb" wrote: Depends on the app you wan't to close. if it supports VBA (autocad, microstation do) you could use the getobject() to instance the app and close it. if it's not yuo will need api to find it's active window and handle and close the thread (look at allapi.net for info on API) N.B. this will require expoerience in VBA, a bit of VB and API -- Dnereb ------------------------------------------------------------------------ Dnereb's Profile: http://www.excelforum.com/member.php...o&userid=26182 View this thread: http://www.excelforum.com/showthread...hreadid=482975 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
VBA Dabbler,
Does Intellisense not give you a list of correct methods/properties etc of the MMApp object ? You can also use the Object Browser to search the object's model. A different point is the use of the "Dim MyObj As New XX" syntax. Although has it's uses, one effect is that whenever you refer to MyObj in code you create an instance of XX, if it does not currently exist. You do not need this functionality, so split this line into the Dim and Set; i.e. Dim MyObj As XX Set MyObj = New XX NickHK "VBA Dabbler" wrote in message ... Does anyone know how to close an application that is "not" in the MS Office Suite? Following is code I used to create a new instance of the object, but can't seem to find the method to close the application: Sub OpenOtherApplication(FilePath, FileName) Dim MMApp As New MindManager.Application Dim FilePathAndName As String FilePathAndName = FilePath & "\" & FileName MMApp.Visible = True MMApp.Documents.Open (FilePathAndName) . . . MMApp.ActiveDocument.Close Set MMApp = Nothing End Sub The above code functions, but I can't close the application - an instance remains with a virgin document - I have to manually close it. Any help would be most appreciated. Regards, VBA Dabbler |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
NickHK,
Who is Intellisense? The MindManager app is from Mindjet Corporation. And yes, I've browsed their object model using Object Browser. But, could not find a close, quit, exit, etc. method for the Application object. I've also sent a tech support request to Mindjet Corporation regarding this issue. Thanks for the tip on the object declaration. Regards, VBA Dabbler "NickHK" wrote: VBA Dabbler, Does Intellisense not give you a list of correct methods/properties etc of the MMApp object ? You can also use the Object Browser to search the object's model. A different point is the use of the "Dim MyObj As New XX" syntax. Although has it's uses, one effect is that whenever you refer to MyObj in code you create an instance of XX, if it does not currently exist. You do not need this functionality, so split this line into the Dim and Set; i.e. Dim MyObj As XX Set MyObj = New XX NickHK "VBA Dabbler" wrote in message ... Does anyone know how to close an application that is "not" in the MS Office Suite? Following is code I used to create a new instance of the object, but can't seem to find the method to close the application: Sub OpenOtherApplication(FilePath, FileName) Dim MMApp As New MindManager.Application Dim FilePathAndName As String FilePathAndName = FilePath & "\" & FileName MMApp.Visible = True MMApp.Documents.Open (FilePathAndName) . . . MMApp.ActiveDocument.Close Set MMApp = Nothing End Sub The above code functions, but I can't close the application - an instance remains with a virgin document - I have to manually close it. Any help would be most appreciated. Regards, VBA Dabbler |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Closing workbooks w/o closing Excel | Excel Discussion (Misc queries) | |||
How do I prevent all excel applications from closing at once? | Excel Discussion (Misc queries) | |||
Closing VB triggers closing Excel | Excel Programming | |||
closing excel after closing a workbook | Excel Programming | |||
Other applications | Excel Programming |