H
Henrik Hansen
Hi,
I'm not sure if this is the right spot?
Having problem with opening project files in .mdb format through
Access. I have made a template in MS Project 2002, which is sharing a
resourcepool. The template allows the user to connect to the
resourcepool and then save the project in database format .mdb.
In the database I have made some queries that extract the information
required from the various project saved. In the queries I have made a
full path column by cancatenating the fields in the following format
Link: "<" & [PROJ_DATA_SOURCE] & ">\" & [PROJ_NAME], this is then
updated in a new table where the link is hyperling format. However
this didn't work.
Then I tried to make the opening through VBA by creating the same link
string and open it through the following code in an Access form
Private Sub PROJ_DATA_SOURCE_Click()
Dim objPrj As Object
Dim strFile As String
strFile = Me.PROJ_NAME
On Error Resume Next
Set objPrj = GetObject("msproject.Application") 'Get the application
if it is running
If Error Then 'Ups it was not running
Set objPrj = CreateObject("msproject.application") 'Create an
instance
End If
FileOpen Name:="<C:\Dokumenter\testProject.mdb>\" & strFile,
ReadOnly:=False, FormatID:="MSProject.MDB8"
Set objPrj = Nothing
End Sub
Nothing happens. If I go to Project and open the files throgh the
normal way it works.
So, it might be a locking issue? I'm using recordlevel locking in the
Access database.
I have tried to use the common dialog code from mvps.org/api but that
didn't help either.
Could anybody give me a hint please?
regards
Henrik
I'm not sure if this is the right spot?
Having problem with opening project files in .mdb format through
Access. I have made a template in MS Project 2002, which is sharing a
resourcepool. The template allows the user to connect to the
resourcepool and then save the project in database format .mdb.
In the database I have made some queries that extract the information
required from the various project saved. In the queries I have made a
full path column by cancatenating the fields in the following format
Link: "<" & [PROJ_DATA_SOURCE] & ">\" & [PROJ_NAME], this is then
updated in a new table where the link is hyperling format. However
this didn't work.
Then I tried to make the opening through VBA by creating the same link
string and open it through the following code in an Access form
Private Sub PROJ_DATA_SOURCE_Click()
Dim objPrj As Object
Dim strFile As String
strFile = Me.PROJ_NAME
On Error Resume Next
Set objPrj = GetObject("msproject.Application") 'Get the application
if it is running
If Error Then 'Ups it was not running
Set objPrj = CreateObject("msproject.application") 'Create an
instance
End If
FileOpen Name:="<C:\Dokumenter\testProject.mdb>\" & strFile,
ReadOnly:=False, FormatID:="MSProject.MDB8"
Set objPrj = Nothing
End Sub
Nothing happens. If I go to Project and open the files throgh the
normal way it works.
So, it might be a locking issue? I'm using recordlevel locking in the
Access database.
I have tried to use the common dialog code from mvps.org/api but that
didn't help either.
Could anybody give me a hint please?
regards
Henrik