Object Excel Worksheet and VBA

R

rongchaua

I've inserted an excel worksheet into a project file (Insert --> Object -->
Microsoft Excel Worksheet). Now I want to use VBA to write and read data from
this worksheet, but I don't know how to do it. I've found 5 Methode, which
are relevant to this Object Excel worksheet : ObjectChangeicon,
objectconvert, objectinsert, objectlinks, objectverb. But none of them can
help me to access this worksheet. Does someone know how we can read/write
from/to this excel worksheet with VBA. Thanx for all support.
 
J

John

rongchaua said:
I've inserted an excel worksheet into a project file (Insert --> Object -->
Microsoft Excel Worksheet). Now I want to use VBA to write and read data from
this worksheet, but I don't know how to do it. I've found 5 Methode, which
are relevant to this Object Excel worksheet : ObjectChangeicon,
objectconvert, objectinsert, objectlinks, objectverb. But none of them can
help me to access this worksheet. Does someone know how we can read/write
from/to this excel worksheet with VBA. Thanx for all support.

rongchaua,
Using VBA to import or export data from Project to other applications is
fairly straightforward once you understand how to work with the Project
(and other application) object models. Let's say you want to import data
from Excel to Project. Basically, the VBA code (assume it is resident in
Project) needs to create a reference to an Excel object, for example,
Set Xl = GetObject(, "Excel.application")
and then access the various Excel objects and put them into Project.

There is a little more to it than that and if you want to learn more
about VBA in Project, go to our MVP website at:
http://www.mvps.org/project/links.htm
Take a look at the link at the bottom of the page for, "Project 98
Visual Basic Environment Training Materials". Even though it says it is
for Project 98, it is equally applicable to all current versions of
Project. For some good examples of Project VBA, including one that uses
cross application exporting, go to fellow MVP, Jack Dahlgren's website
at: http://masamiki.com/project/macros.htm

By the way, inserting the Excel object into Project is NOT what you
want. It only makes things a lot more complex.

John
Project MVP
 

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