Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open MS Project From Excel & read Task Properties List

I want to open a MS Project file and create a list of the Task table field
names. (e.g. ID, Name, Start, Finish, etc.) I want the complete list of field
names to populate to an Excel worksheet.

I am looking for code to do two things:

1: List the Task table field names from the task collection

2: Possibly open the MS project file without having a copy of MS project open.

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Open MS Project From Excel & read Task Properties List

Oops, let's see. Something like this:

Dim projectApplication As New MSProject.Application

projectApplication.FileOpenEx "C:\data\temp\project.mpp"


Dim field As tableField

For Each field In
projectApplication.ActiveProject.TaskTables(projec tApplication.ActiveProject.CurrentTable).TableFiel ds
Debug.Print field.Title
Next

Is that what you are looking for?

Colby

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open MS Project From Excel & read Task Properties List

Seems close.



I get lots of blanks for titles and I am not sure if it is giving me the
same list as the enums that you get from taskItem.Name in your last post.

What I want is the same list that pops up when you type taskitem and the
period. I just want to loop through and I will send it off to an array.

Thanks again

"Colby Africa" wrote:

Oops, let's see. Something like this:

Dim projectApplication As New MSProject.Application

projectApplication.FileOpenEx "C:\data\temp\project.mpp"


Dim field As tableField

For Each field In
projectApplication.ActiveProject.TaskTables(projec tApplication.ActiveProject.CurrentTable).TableFiel ds
Debug.Print field.Title
Next

Is that what you are looking for?

Colby


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Open MS Project From Excel & read Task Properties List

I get the same result. Let me try it another way...

Colby

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Open MS Project From Excel & read Task Properties List

Got it:

Dim projectApplication As New MSProject.Application

projectApplication.FileOpenEx "C:\data\temp\project.mpp"

Dim field As TableField

For Each field In
projectApplication.ActiveProject.TaskTables(projec tApplication.ActiveProject.CurrentTable).TableFiel ds
Debug.Print FieldConstantToFieldName(field.field)
Next

I was missing the call out to FieldConstantToFieldName

Colby



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Open MS Project From Excel & read Task Properties List

Excellent! Thanks!

"Colby Africa" wrote:

Got it:

Dim projectApplication As New MSProject.Application

projectApplication.FileOpenEx "C:\data\temp\project.mpp"

Dim field As TableField

For Each field In
projectApplication.ActiveProject.TaskTables(projec tApplication.ActiveProject.CurrentTable).TableFiel ds
Debug.Print FieldConstantToFieldName(field.field)
Next

I was missing the call out to FieldConstantToFieldName

Colby


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Open MS Project From Excel & read Task Properties List

No problem! Please rate this post if it was helpful and have a great
holiday!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
export Exel task list into Project 2002? TechoPM Excel Discussion (Misc queries) 1 January 15th 09 10:46 PM
How do I hyperlink from excel to a task in project? PM@Key Excel Discussion (Misc queries) 0 September 20th 07 07:28 PM
How do I import a date from a project scehdule task into excel? Bill L. Excel Worksheet Functions 0 September 8th 07 01:26 PM
With VBA from Excel: Open Project, extract resource list and copy it to a worksheet, close project. Tony Excel Programming 1 October 18th 05 03:53 PM


All times are GMT +1. The time now is 09:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"