Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2004

Tip: Looking for answers? Try searching our database.

Opening Excel from Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill - 29 Feb 2004 21:32 GMT
My computer at work has Word 97 installed and therefore
have to program in Word 97, but my home computer has
Excel XP (2002) installed.  I am trying to open Excel
from Word with the following code but it won't open and
debugs,

Sub Work_On_Excel_File()

Dim oXL As Excel.Application

End sub

Can anyone offer any solutions, please?

Bill
Jonathan West - 29 Feb 2004 21:46 GMT
Hi Bill

Take a look here

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

Signature

Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup

> My computer at work has Word 97 installed and therefore
> have to program in Word 97, but my home computer has
[quoted text clipped - 11 lines]
>
> Bill
Jezebel - 29 Feb 2004 22:35 GMT
For early binding to work (which is what you are using) you need a project
reference to the Excel library. This is on the Tools > References list in
VBE. The problem you've got here is that to work with Excel 97, you need a
reference to Excel version 8(?) (Excel8.olb); while the XP machine will have
Excel 10+.

If you bring up the References list you should see the Excel reference
listed and marked "MISSING". Clear the missing reference, scroll down to and
select Microsoft Excel object library.

Alternatively, use late binding. This code will also work --

Dim oXL as object
Set oXL = CreateObject("Excel.Application")

That should work on either machine, since it fetches whatever is in the
registry as answering to "Excel.Application".

> My computer at work has Word 97 installed and therefore
> have to program in Word 97, but my home computer has
[quoted text clipped - 11 lines]
>
> Bill
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.