Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting to the Project Notes via Excel VBA 1

Status
Not open for further replies.

R3D3

Programmer
May 1, 2002
34
FR
I understand that there are some limitations in MSProject regarding the Notes. ie you can only see the first so many characters unless you go onto the actual Dialogue box that maintains the text.
It seems the same limitation is in VBA structure.
eg projApp.ActiveProject.Tasks.Item(n).Notes is string that finishes with "..."
I'm using MSProject 98 but I think the same limitation is forwardly compatable...
Is the rest of the Note held in some overflow field in the VBA structure?
 
If you copy directly from the project.tasks(n).Notes field to an Excel cell then you get the first 255(?) characters *or* the characters until a CRLF is detected at which point you get the "...".

To move the text from a project.tasks(n).Notes field to an Excel cell you have to move it from the .Notes field to a temporary field and then move the temporary field to the Excel cells(iRow,iCol).value field.

Now ... all you have to do is determine when the column you are dealing with is a Notes column.

Your next limit will be imposed by Excel since the Project Notes field can hold more data than an Excel cell can hold.

(I tested this with P98, btw.)
 
Hi PDQBach,
One limit at a time:)
If I understand correctly, I'm already doing this...

tTNotes = projApp.ActiveProject.Tasks.Item(T).Notes
xlApp.Cells(n, cTNotes).Value = tTNotes

but even in tTNotes I only get the 253 chars.
If I view the projApp.ActiveProject.Tasks.Item(T).Notes in the immediate window again I see truncated with ...

eg of data string in tTNotes:
Produced by the Rollout PM
Ref: Brief.doc
The purpose of this document is to provide a firm foundation for the initiation of the project.
Background.
Project Definition:-
Project Objectives
Project Scope
Outline Project Deliverables and/or Desired Ou...

I must be doing something differently if it worked for you in P98. Thanks, R3D3.
 
My code is a VBA routine in Project which loads Excel and then pushes data from the Project file to an Excel worksheet. Maybe the alternative doesn't work (i.e. a VBA routine in Excel that pulls the data from Project).

If I get a chance, I'll try the reverse scenario.
 
You are abolutely spot on.
Thanks.
 
I just tried it again, this time using Excel to load Project and then pull the data from Project.

It does seem to work both ways (Excel VBA pulling from Project as well as Project VBA pushing to Excel).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top