Hi
I am using Project 2000 and trying to copy some text from an Excel Spreadsheet range to the Title labels of the MS Project Text Field Columns (Text1-TextN) using a macro which edits the Table Entry and adds the text columns and changes the column definition label "Title" to the data supplied by the Excel Spreadsheet. E.g In Project Field Name "Text1" is added to the table entry view with the Title: "John Smith" (imported from Excel). I need to re-run the import when the data in the Excel file is changed.
I have the basic code working using TableEdit Name to add each column to
the end of the tasks table as follows:
TableEdit Name:="&Entry", TaskTable:=True, NewFieldName:="Text" & lnCounter, _
Title:=vaTeammembers(lnCounter, 1), Width:=10, Align:=2, ShowInMenu:=True, LockFirstColumn:=True, _
RowHeight:=1, ColumnPosition:=-1, AlignTitle:=1
(vaTeammembers is the data in Excel, lncounter is the row number of the data - 1 to N, Column position -1 adds the new column to the right of the last column).
However, each time the Macro runs it "adds" the columns to the table entry view again. That is columns Text1 to N (with new Title Labels) are duplicated.
Any ideas how to stop the TableEdit if any Text1-N column has a "Title" label the same as the Excel file data being imported or an alternative workaround to stop the columns being duplicated each time the import macro is run. I guess I need to access the "Title" Label value for each Text column and compare to the vaTeammembers(lnCounter, 1) value but not sure if it is possible or how in MSProject 2000.
TIA