Working with other Office Apps

G

Glenn

Hello,

I am running the following code unsuccessfully. I do have the Excel
object library loaded from the Tools, Reference menu selection in
VBE so I'm not sure what is crashing. Also, if I start MS Project and
open the VBE and load the Excel object library, I can sucessfully
launch MS Project from Excel's VBE by replacing Excel.exe with
Winproj.exe

Any ideas??

Sub OpenExcel()
AppExecute Command:="Excel.exe"
End Sub
 
J

Jan De Messemaeker

Hi Glenn

I never used appexecute but the following opens excel:

Dim xlapp as excel.application
set xlapp=createobject ("excel.application")

Just by curiosity I tried the appexecute in 2000 and 2003 and it worked each
time.
You ARE in Project VBE are you?
Looks to me you're trying to launch Excel from Excel VBE...

HTH
 
G

Glenn

Jan,
Yes, I am in Project VBE trying to launch Excel. If I go to
Excel VBE and try to launch Project, it works fine but if
I am in Project VBE trying to launch Excel, it complains.
 
G

Glenn

Jan,

Also, by using your code from Project VBE, I am unable
to start Excel. Is there a method within xlapp that I
need to invoke?

Dim xlapp As Excel.Application
Set xlapp = CreateObject("excel.application")
 
J

Jan De Messemaeker

Hi Glenn,

For me it starts allright.
Maybe you couls try
xlapp.visible=true
To check.
HTH
 
G

Glenn

Jan,

I see a little flicker when I run this code so I decided to put a breakpoint
on the last line. When I press F8 to step into it, Excel is open and when
I press F8 again, the routine is done and Excel is closed. How can I keep
Excel open ?

thanks again,
glenn
 
J

Jan De Messemaeker

Hi Glenn,

I think now I got it.
Before running the code go to Ctrl-Alt-Delete and in the task manager look
for an "invisible" instance of Excel. You may find several. Stop them. Now
it will work.
HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top