Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
CreateObject - start Access from Excel
Hi folks,
Am trying to start an Access database from VBA, but it closes itself when the code finishes. I simply don't want this to happen. The following code works fine if I change the Access into Word (see the comment): Sub StartApp() Dim OtherApp As Object ' Set OtherApp = CreateObject("Word.Application") Set OtherApp = CreateObject("Access.Application") OtherApp.Visible = True End Sub Any help please? TIA, Piers |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
CreateObject - start Access from Excel
Roedd <<Piers 2k wedi ysgrifennu:
Hi folks, Am trying to start an Access database from VBA, but it closes itself when the code finishes. I simply don't want this to happen. The following code works fine if I change the Access into Word (see the comment): Sub StartApp() Dim OtherApp As Object ' Set OtherApp = CreateObject("Word.Application") Set OtherApp = CreateObject("Access.Application") OtherApp.Visible = True End Sub Any help please? TIA, Piers Move the declaration (Dim statement) outside the sub procedure. The variable is going out of scope when the procedure exits and this kills the application it refers to. -- Rob |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
CreateObject - start Access from Excel
Arrrggghhh! Don't you hate it when it's obvious!
Thanks - much appreciated! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
CreateObject - start Access from Excel
It does not close if you open a file
Regards JY "Piers 2k" wrote in message ... Arrrggghhh! Don't you hate it when it's obvious! Thanks - much appreciated! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I have an access to XL Start folder? | Excel Worksheet Functions | |||
Createobject returns null in Excel | Excel Discussion (Misc queries) | |||
Excel CreateObject on server | Excel Programming | |||
Start button / timing access | Excel Programming | |||
CreateObject("Excel.Application") - Access denied | Excel Programming |