L
lance-news
I have some code to open a program. The problem is that when the
applicaton opens it becomes the active window. I need to have Excel
as the active window when the Sub is finished. How can I do this?
Lance
Sub Openfile()
Dim Varlist As String
'OPEN DIALOG BOX TO OPEN SPSSFILE
OFile = Application.GetOpenFilename("SPSS Datafile, *.sav")
'USE OLE TO OPEN SPSS
Set oApp = CreateObject("SPSS.Application")
Set oDoc = oApp.OpenDataDoc(OFile)
oDoc.Visible = True
'Another way to open file
'sCommands = "GET FILE = ' " & OFile & " ' "
'oApp.ExecuteCommands sCommands, True
'USE OLE TO OPEN OUTPUT DOC
Set oOut = oApp.NewOutputDoc
oOut.Visible = True
End Sub
applicaton opens it becomes the active window. I need to have Excel
as the active window when the Sub is finished. How can I do this?
Lance
Sub Openfile()
Dim Varlist As String
'OPEN DIALOG BOX TO OPEN SPSSFILE
OFile = Application.GetOpenFilename("SPSS Datafile, *.sav")
'USE OLE TO OPEN SPSS
Set oApp = CreateObject("SPSS.Application")
Set oDoc = oApp.OpenDataDoc(OFile)
oDoc.Visible = True
'Another way to open file
'sCommands = "GET FILE = ' " & OFile & " ' "
'oApp.ExecuteCommands sCommands, True
'USE OLE TO OPEN OUTPUT DOC
Set oOut = oApp.NewOutputDoc
oOut.Visible = True
End Sub