Consulting

Results 1 to 3 of 3

Thread: Copy Data from Excel to Project 2000

  1. #1
    VBAX Newbie
    Joined
    Nov 2007
    Posts
    1
    Location

    Copy Data from Excel to Project 2000

    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

  2. #2
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Hi Pro53,
    I don't have Project so can't be much help but I moved your thread to the MS Project help forum and hopefully a regular Project user will drop by and help you with this.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Regular
    Joined
    Dec 2007
    Posts
    12
    Location
    Hi Pro53,

    If I read question I understand that it is possible with VBA to exchange data between Excel and MSProject. I do not complete understand how?
    From Excel I must open the MSProject file and then copy some relevant data to MSProject. If I open the mpp file from excel how can I achieve that I copy the data into the mpp file?
    Can you help me with a example?

    Thanks in advance?

    Nico

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •