C
Chris
Hi All --
I'm working on a macro that will loop through a list of projects (in Excel)
that I need to modify. I wrote some VBA code that gets the list of projects
but on FileOpen, MS Project says it cannot find the file. I'm using Project
2003 - all projects are stored in Project Server 2003.
Here's the relevant code:
- start code -
Dim oXLApp As Object
Dim oXLSheet As Object
Dim oXLBook As Object
Dim i As Integer
Set oXLApp = CreateObject("Excel.Application")
Set oXLBook = oXLApp.Workbooks.Open("C:\epmdev.xls")
Set oXLSheet = oXLBook.Worksheets(1)
For i = 1 To10
'Debug.Print oXLSheet.Cells(i, 1).Value
FileOpen Name:="<>\oXLSheet.Cells(i, 1).Value"
Next i
- end code -
The value of oXLSheet.Cells(i, 1).Value is showing up correctly; I guess I'm
wondering if there's something additional I need to pass in FileOpen since
these are enterprise projects and not .mpp files. I've also verified that
the projects are there and indeed valid published project names.
Does anyone have any suggestions on what I'm missing?
Thanks for any help that could be provided!
- Chris
I'm working on a macro that will loop through a list of projects (in Excel)
that I need to modify. I wrote some VBA code that gets the list of projects
but on FileOpen, MS Project says it cannot find the file. I'm using Project
2003 - all projects are stored in Project Server 2003.
Here's the relevant code:
- start code -
Dim oXLApp As Object
Dim oXLSheet As Object
Dim oXLBook As Object
Dim i As Integer
Set oXLApp = CreateObject("Excel.Application")
Set oXLBook = oXLApp.Workbooks.Open("C:\epmdev.xls")
Set oXLSheet = oXLBook.Worksheets(1)
For i = 1 To10
'Debug.Print oXLSheet.Cells(i, 1).Value
FileOpen Name:="<>\oXLSheet.Cells(i, 1).Value"
Next i
- end code -
The value of oXLSheet.Cells(i, 1).Value is showing up correctly; I guess I'm
wondering if there's something additional I need to pass in FileOpen since
these are enterprise projects and not .mpp files. I've also verified that
the projects are there and indeed valid published project names.
Does anyone have any suggestions on what I'm missing?
Thanks for any help that could be provided!
- Chris