ms project code...

  • Thread starter Thread starter mission2java_78
  • Start date Start date
M

mission2java_78

Guest
Does anyone know or has programmed in MS Project?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Basically behind the Visual Basic macro window I've captured some values from 2 different project files...I want to be able to send these values to an excel spreadsheet for instance:

I grab a commission number a cost unit and 2 dates:

C.2020 170 11/12/01 11/12/02


Then I want to send this to Excel...

After im done I should have an excel spreadsheet that looks like this:

Comm Cost D1 D2
C.2020 170 11/12/01 11/12/02
.....
.....

C.XXX...

and so on

Anyone know or can offer any help to send this data to excel?

Jon
 
Well, if you are doing this from VB, you can try to do some COM work (Component Object Model). You need the appropriate references to Excel, which should be available if you have a full Office installation.

The Excel Help files have a section on VBA for Office that includes a few topics on objects available under Excel. The ugliest part of it is just slogging your way through the list of components that Excel exposes to the world through that model.

The way you do this in general is

Create an Excel application object.

Open a workbook under that object.

Select a worksheet under that workbook. Make it the active sheet. Keyword .ActiveSheet becomes meaningful when you do.

From there, you can directly address the cells of the worksheet by using the collections presented under COM. You can either go by the .Rows collection, then use .Rows(n).Cells collection to get to the columns. Or you could do the .Columns(m).Cells collections to get to the rows.

Muck your spreadsheet. Do a .Save or .SaveAs method on the object. Make sure if you do a .SaveAs that you give it a good name.

OK, close the workbook and the application. You are done.
 
I got this using...used the basic Project and Excel objects.

Piece of cake..didnt think it was so easy

Thank Yas doc.
 

Users who are viewing this thread

Back
Top Bottom