Calling a GUI from excel and keeping it open
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi there, need a way to keep a GUI called from excel VBA code open, I am using matlab automation server as my code below shows:
Private Sub openmatlab()
Dim hMatlab As Object
Dim sDir As String, scdDir As String, s1 As String
Dim Result As String
Set hMatlab = CreateObject("matlab.application")
s1 = "'"
sDir = s1 & ActiveWorkbook.path & s1
scdDir = "cd(" & sDir & ")"
hMatlab.Execute (scdDir)
Result = hMatlab.Execute("starter")
MsgBox "Matlab er lukket", vbOK, "Matlab"
End Sub
As you might be able to see I am using a messagebox to stop the GUI from shutting down, but that makes excel "blink" all the time, and is annoying, any thoughts on how to do it better?
0 comentarios
Respuestas (2)
Robert Cumming
el 6 de Jun. de 2011
In your VBA code you could try the option
Application.ScreenUpdating = False
I have no experience of running matlab from Excel, but that used to stop the "blinking" back in the day when I ran macros.
Johan
el 7 de Jun. de 2011
2 comentarios
Robert Cumming
el 7 de Jun. de 2011
if you provide a bit more details?
What is your matlab function doing? Is it a GUI? and do you want to wait until the GUI closes before control returns to excel?
If so have you tried uiwait(yourGUIHandle). That should stop it.
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!