Accessing Excel From Word

C

Carolyn Speakman

Hi,

I'm fairly new to VBA and I'm trying to open Excel from word but it's not working. I'm using Office 2003, and this is the code:

Dim excelTemp As Object
Set excelTemp = CreateObject(Excel.Application)

I've also tried declaring excelTemp As Excel.Application, but it's not recognised as an object type.

Anyone got any ideas??
Carolyn
 
J

Jonathan West

Carolyn Speakman said:
Hi,

I'm fairly new to VBA and I'm trying to open Excel from word but it's not
working. I'm using Office 2003, and this is the code:
Dim excelTemp As Object
Set excelTemp = CreateObject(Excel.Application)

I've also tried declaring excelTemp As Excel.Application, but it's not recognised as an object type.

Anyone got any ideas??
Carolyn

Hi Carolyn

Take a look at this article

Control Excel from Word
http://word.mvps.org/FAQs/InterDev/ControlXLFromWord.htm
 
C

cisco kid

hi - I think you are missing the quotes around Excel.Application
ie Set excelTemp = CreateObject("Excel.Application")
 
C

Chad DeMeyer

Or if you use the early binding method (i.e., declaring excelTemp as
Excel.Application), you must add a reference in your project to the
Microsoft Excel 11.0 Object Library, using Tools>References.

Regards,
Chad
 

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