macro : ConsolidateProjects FileNames

G

Girija

I was trying to write a macro which takes the input of the filename from the
user. Then uses the filename to replace in the ConsolidatedProjects as given
below

ConsolidateProjects FileNames:=file_string, hidesubtasks:=False

For this I will have to do the following :

1) Create a Directory List Box
2) Then replace in ConsolidateProjects using the file selected from the
Directory List Box

My question is :

How will I know the pathname where the projects are saved in Project server
2003?
Then has anyone done such thing so that I can refer as how to use
ConsolidateProjects taking the input filename from the user?
 
J

John

Girija said:
I was trying to write a macro which takes the input of the filename from the
user. Then uses the filename to replace in the ConsolidatedProjects as given
below

ConsolidateProjects FileNames:=file_string, hidesubtasks:=False

For this I will have to do the following :

1) Create a Directory List Box
2) Then replace in ConsolidateProjects using the file selected from the
Directory List Box

My question is :

How will I know the pathname where the projects are saved in Project server
2003?
Then has anyone done such thing so that I can refer as how to use
ConsolidateProjects taking the input filename from the user?

Girija,
I don't work with Project Server but getting filenames to use in the
ConsolidateProjects Method should be independent of whether Server is
involved or not. I can think of two approaches for getting the filename.
The first approach is to use an InputBox to directly ask the user for a
filename, however extra code would be required to get the full path if
the user didn't provide it directly. The second approach is to utilize
an API routine to pop up an Explorer window so the user can navigate to
and select the desired file. With this method the full path is instantly
available. The latter approach requires you to create a class module for
the API and then call it from your VBA code. Full details on doing this
are contained in fellow MVP, Rod Gill's new book on Project VBA. You can
find out more about the book at: http://www.projectvbabook.com

John
Project MVP
 
G

Girija

Hi John,

I had already done what you mentioned in your first case and was exploring
second option. Since I hadn't used much of API thought there may be some
other way. Thanks once again let me go through the link and get back to you
if need be.

Thanks

Girija
 
J

John

Girija said:
Hi John,

I had already done what you mentioned in your first case and was exploring
second option. Since I hadn't used much of API thought there may be some
other way. Thanks once again let me go through the link and get back to you
if need be.

Thanks

Girija

Girija,
You're welcome. I see that Rod gave you the link to an example for the
API I was mentioning. Hope that works out for you.

John
 
G

Girija

Hi John ,

I tried that API given by Rod, it opens the windows browser and not the
Microsoft Project server File -> Open . I need to know how to access
Microsoft Project server File -> Open.

Thanks
Girija
 
G

Girija

Hi John,

Thanks John. One more question please. I tried to use api, but will I know
where the published projects are stored? I mean whenever a project is
published it has to be saved in some format at some location. Any idea on
this please.

Thanks
Girija
 
J

John

Girija said:
Hi John,

Thanks John. One more question please. I tried to use api, but will I know
where the published projects are stored? I mean whenever a project is
published it has to be saved in some format at some location. Any idea on
this please.

Thanks
Girija

Girija,
You're welcome. If you are talking about published projects, that is
part of Project Server and I don't do Server. However, it looks like Rod
is helping you in your other post.

John
Project MVP
 
G

Grimm

hi girija

the only way i know is to ask the sql server
create a view (with access to all you domain user / (global) ad-group / all)
SELECT REPLACE([PROJ_PROJECT], '<>\','') AS DiplayName

,[PROJ_PROJECT]+'.'+[PROJ_VERSION] as Fullname

FROM [ProjectServer].[dbo].[MSP_PROJECTS]

WHERE [PROJ_TYPE]=0

AND [PROJ_ADMINPROJECT]=0



Result

DiplayName | Fullname

-----------------------|-----------------------------

EP0364-2_cccc | <>\EP0364-2_ccc.Veröffentlicht

EP0365-2_XXX | <>\EP0365-2_XXX.Veröffentlicht

DisplayName for viewing
Fullname for application.fileopen or ConsolidateProjects

may be you wanna also Filter [PROJ_VERSION]
take a look to [PROJ_TYPE]=0 is this the right thing for on the project
server is a help file
 
G

Girija

Grimm said:
hi girija

the only way i know is to ask the sql server
create a view (with access to all you domain user / (global) ad-group / all)
SELECT REPLACE([PROJ_PROJECT], '<>\','') AS DiplayName

,[PROJ_PROJECT]+'.'+[PROJ_VERSION] as Fullname

FROM [ProjectServer].[dbo].[MSP_PROJECTS]

WHERE [PROJ_TYPE]=0

AND [PROJ_ADMINPROJECT]=0



Result

DiplayName | Fullname

-----------------------|-----------------------------

EP0364-2_cccc | <>\EP0364-2_ccc.Veröffentlicht

EP0365-2_XXX | <>\EP0365-2_XXX.Veröffentlicht

DisplayName for viewing
Fullname for application.fileopen or ConsolidateProjects

may be you wanna also Filter [PROJ_VERSION]
take a look to [PROJ_TYPE]=0 is this the right thing for on the project
server is a help file

Girija said:
I was trying to write a macro which takes the input of the filename from
the
user. Then uses the filename to replace in the ConsolidatedProjects as
given
below

ConsolidateProjects FileNames:=file_string, hidesubtasks:=False

For this I will have to do the following :

1) Create a Directory List Box
2) Then replace in ConsolidateProjects using the file selected from the
Directory List Box

My question is :

How will I know the pathname where the projects are saved in Project
server
2003?
Then has anyone done such thing so that I can refer as how to use
ConsolidateProjects taking the input filename from the user?
 

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