Missing 12.0 Object Library? VBA launches wrong MSP client.

Q

Quized again

MOPS2007 system. First explanation then questions.
I have tried to use some Excel VBA code I found in the postings but it does
not run. It seems to need the MSP 12.0 object library. I checked the
Tools>References in my Excel (which is 2003) and the MSProject 12.0 object
library is not listed.

I tried to add it so I browsed to c:\windows\assembly and selected
"Microsoft.Office.Interop.MSProject" version 12.0 and nothing happens when I
try to add it. THe browse window just resets itself to the first files in
that assembly directory. If I rt-click I have the option to uninstall it.

Ok, so we rewrote the code to this and it is trying to launch MOPS2003, not
2007.

Sub Test2()
'Requires Reference to Microsoft Project
Dim projApp As MSProject.Application
'
On Error Resume Next
'Uses Windows Authentication as no username or password parameters added

Shell "winproj.exe /s http://my_servername_here/instance_name_here"
Do Until Not (projApp Is Nothing)
DoEvents
Set projApp = GetObject(, "MSProject.Application")
Loop
Debug.Print projApp.Name
Debug.Print projApp.Profiles.ActiveProfile.ConnectionState
projApp.Quit
Set projApp = Nothing
End Sub

Questions are.
1. Shouldn't I already have the 12.0 object library available for selection
in the Excel references if I am using MSP Pro 12.0?
2. How do I get MSP 12.0 object library to show in the Excel 2003 references?
3. Is there some code snip to add so that MSP2007 Pro launches instead of
MSP Pro 2003?
 
Q

Quized again

I solved the issue of opening the wrong version of MSP Pro.

Sub StartMSPPro()
Shell "C:\Program Files\Microsoft Office\Office12\winproj.exe /s
http://myserver/myinstance"
End Sub

Not elegant, but works. I guess I was thinking it should be more generic
rather than the path being spelled out.

Still wondering about the 12.0 object library...hmm.

Still do
 
Q

Quized again

Thanks. I had performed a search on "object library" and that did work like a
search on PIA, so I appreciate your help. Your help enabled me to find what I
sought and it works. BTW I had modified the code to use the path to the
global for 12.0 and that worked also. I am not sure how the code would know
which "winproj.exe" to use (2003 or 2007). The path idea worked. Anyway You
have really helped me because other code I have downloaded needed the 12.0
PIA and I did not have it. Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top