Problem opening Excel through Access

Frosty328

New member
Local time
Today, 11:29
Joined
Dec 18, 2011
Messages
3
Hi everyone,
This is my first post on this site so I apologise in advance if I am not making any sense.

I've embedded 2 VBL codes into 2 buttons. One of the code's work, however the other one doesn't.
Code:
Private Sub Command31_Click()
Dim oApp As Object
Set oApp = CreateObject("Excel.Application")
oApp.Visible = True
End Sub
Code:
Private Sub Command53_Click()
Dim oApp As Object
Set oApp = CreateObject("Word.Application")
oApp.Visible = True
End Sub

The 2nd code works, but the first one doesn't. Thus when I click the button named "Command53", it opens up Microsoft Word. However when I click the button named "Command31", it doesn't work. What happens is it tries to open but fails.

Does anyone know why this might be happening and what the soultion is?
 
Last edited:
Check to see that you don't have an extra EXCEL.EXE process running in your task manager before testing. You might have one still hanging around from some testing. Kill that process before trying again.
 
It's going out of scope. It's either you do something with it or set the UserControl to True.
Code:
oApp.UserControl = True
[COLOR=Blue]End Sub[/COLOR]
 

Users who are viewing this thread

Back
Top Bottom