Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Ms Project to Excel Linked

Hi everyone
Lots of great info on here and help,
My problem is I have a Ms Project File which gets updated
New Lines inserted and deleted in the project file
I need certin information to export to excel and then further work happens
in excel from there (which is ok)
The problem I have is if there is more data added in the project file, it
does not automatically come through into the excel file
I don't want to do an export to new file every time if I can help it.
I have a paste link from project to excel in excel8.0 link type if that make
sense

Does anyone have any code or ideas of what I could use to keep the 2 files
in sync.
I can add some extra columns in project like UniqueID and an Export Date,
but that doesn't help me with the new lines at the moment

Any Idea would be very much appreciated, I can put up the code I have so far
and the files for amy one to look at

Thanks for your help
Phil Keoghan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Ms Project to Excel Linked

this is the type of lik I get into excel when I do a paste special from
project to excel as a link Excel 8.0
=MSProject.Project.9|'C:\Users\Phil\Desktop\Projec t\2010
Project.mpp'!'!LINK_3'
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default Ms Project to Excel Linked

{=MSProject.Project.9|'C:\Users\Phil\Desktop\Proje ct\2010Project.mpp'!'!LINK_3'}
Sorry thats how it comes out with the brackets

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 220
Default Ms Project to Excel Linked

Here's some sample VBA for how you can query an MS Project file from Excel
rather than having a link. The sample uses ActiveX data objects and queries
the project file directly. You can put this code (or a call to it) into the
Workbook_Open event in the Excel file to have the data update automatically
every time the file is opened. You'll have to decide which fields you want
to query, and then write the data to whatever worksheet you want it on (after
first clearing out the old data).

The sample writes the data to a text file.

HTH,

Eric

Option Explicit

Const MY_FOLDER = "D:\myFolder\"
Const PROJ_FILE_NAME = "My_Project_File.mpp"

Sub ConnectLocally()
Dim conData As New ADODB.Connection
Dim rstAssigns As New ADODB.Recordset
Dim intCount As Integer
Dim strSelect As String
Dim strResults As String

conData.ConnectionString =
"Provider=Microsoft.Project.OLEDB.11.0;PROJECT NAME=" & MY_FOLDER &
PROJ_FILE_NAME

conData.ConnectionTimeout = 30
conData.Open

strSelect = "SELECT TaskStart, TaskFinish, TaskName, TaskBaselineStart,
TaskBaselineFinish, " & _
"TaskCompleteThrough, TaskConfirmed, TaskCreated,
TaskEarlyStart, " & _
"TaskEarlyFinish, TaskLateStart, TaskLateFinish,
TaskResourceInitials, " & _
"TaskResourceNames, TaskSuccessors FROM Tasks WHERE
TaskUniqueID 0 ORDER BY TaskUniqueID "
rstAssigns.Open strSelect, conData

Do While Not rstAssigns.EOF
For intCount = 0 To rstAssigns.Fields.Count - 1
strResults = strResults & "'" & _
rstAssigns.Fields(intCount).Name & "'" & _
Space(40 - Len(rstAssigns.Fields(intCount).Name)) & vbTab & _
CStr(rstAssigns.Fields(intCount).Value) & vbCrLf
Next
strResults = strResults & vbCrLf
rstAssigns.MoveNext
Loop

conData.Close

Open MY_FOLDER & "Results.txt" For Output As #1
Print #1, strResults
Close #1

Shell "Notepad " & MY_FOLDER & "Results.txt", vbMaximizedFocus

End Sub


"Phil" wrote:

Hi everyone
Lots of great info on here and help,
My problem is I have a Ms Project File which gets updated
New Lines inserted and deleted in the project file
I need certin information to export to excel and then further work happens
in excel from there (which is ok)
The problem I have is if there is more data added in the project file, it
does not automatically come through into the excel file
I don't want to do an export to new file every time if I can help it.
I have a paste link from project to excel in excel8.0 link type if that make
sense

Does anyone have any code or ideas of what I could use to keep the 2 files
in sync.
I can add some extra columns in project like UniqueID and an Export Date,
but that doesn't help me with the new lines at the moment

Any Idea would be very much appreciated, I can put up the code I have so far
and the files for amy one to look at

Thanks for your help
Phil Keoghan


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
Project - VBA Project window - Excel 2003 Jarek Kujawa[_2_] Excel Programming 9 October 1st 09 08:00 AM
Displaying linked data in excel 2007 when linked file is not avail Eng_19 Excel Discussion (Misc queries) 0 December 7th 07 07:27 PM
Linked Budget Worksheets - What to do when Project Shifts in Time? RavenPM Excel Discussion (Misc queries) 1 June 10th 07 06:52 AM
How to convert MS Project to MS Excel. I don't have MS Project. Jane Excel Discussion (Misc queries) 1 February 20th 06 10:01 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 06:30 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"