ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Re-Starts after shut-down (https://www.excelbanter.com/excel-programming/379730-excel-re-starts-after-shut-down.html)

SteveP

Excel Re-Starts after shut-down
 
I have a VBA in Excel. It runs successfully on a stand alone PC,
reading files, directories, etc on the network.

We recently put it on the webserver, and created a link on a webpage.
The .xls file loads and the program runs fine (it does start slow). I
have an EXIT button where I use ".quit" - the program disappears and
then excel opens on my PC and starts the program over again. I hit EXIT
a second time and it shuts down finally.

When I have Program Manager open and the web brower is running the
application - it does not show Excel as an open application.

When it re-starts of course Excel shows.

The program opens several workbooks and collects information into
arrays that are used to populate a userform.

This is the code for EXIT button:

Private Sub ExitButton_Click()
Dim xlApp As Excel.Application
Set xlApp = GetObject(, "Excel.application")
xlApp.Visible = True
xlApp.Quit
Set xlApp = Nothing
End Sub


NickHK

Excel Re-Starts after shut-down
 
Steve,
If this is Excel code, then why use GetObject ?
It should work with Application.Quit

You do know MS do not support Office apps used in this server environment ?

NickHK

"SteveP" wrote in message
oups.com...
I have a VBA in Excel. It runs successfully on a stand alone PC,
reading files, directories, etc on the network.

We recently put it on the webserver, and created a link on a webpage.
The .xls file loads and the program runs fine (it does start slow). I
have an EXIT button where I use ".quit" - the program disappears and
then excel opens on my PC and starts the program over again. I hit EXIT
a second time and it shuts down finally.

When I have Program Manager open and the web brower is running the
application - it does not show Excel as an open application.

When it re-starts of course Excel shows.

The program opens several workbooks and collects information into
arrays that are used to populate a userform.

This is the code for EXIT button:

Private Sub ExitButton_Click()
Dim xlApp As Excel.Application
Set xlApp = GetObject(, "Excel.application")
xlApp.Visible = True
xlApp.Quit
Set xlApp = Nothing
End Sub





All times are GMT +1. The time now is 07:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com