Automatically acknowledging links between projects 
Author Message
 Automatically acknowledging links between projects

I recorded a macro that opens three files and then creates a new window with
those three files. I did figure out how to open the files without opening
the resource pool, but I haven't figured out how to open them without being
prompted to accept updated external links.

I'm just a novice VBA programmer. The last two opens work OK. The first open
is the one I have been experimenting with to see how to open the file and
accept the links. It's based on some examples I found in help. Closing the
window without accepting the updated links would also be acceptable.

Any suggestions?

Sub OpenHPSFiles()
' Macro OpenHPSFiles
' Macro Recorded Tue 12/18/01.

    Dim pj As Object
    Set pj = CreateObject("MSProject.Project")

    With pj.Application
        .LinksBetweenProjects (AcceptAll)
        .FileOpen Name:="\\Fox-coc02-bdc\projsched\HPS Control and
IO\FCP270.mpp", _
            ReadOnly:=True, FormatID:="MSProject.MPP",
OpenPool:=pjDoNotOpenPool
    End With

    FileOpen Name:="\\Fox-coc02-bdc\projsched\HPS Control and IO\ZCP &
RCP.mpp", _
        ReadOnly:=True, FormatID:="MSProject.MPP", OpenPool:=pjDoNotOpenPool

    FileOpen Name:="\\Fox-coc02-bdc\projsched\Engineering
Services\FPS400-24.mpp", _
        ReadOnly:=True, FormatID:="MSProject.MPP", OpenPool:=pjDoNotOpenPool

    WindowNewWindow Projects:="\\Fox-coc02-bdc\projsched\HPS Control and
IO\FCP270.mpp, \\Fox-coc02-bdc\projsched\Engineering
Services\FPS400-24.mpp,\\Fox-coc02-bdc\projsched\HPS Control and IO\ZCP &
RCP.mpp", View:="Gantt Chart", ShowDialog:=False

End Sub

--
Mike



Sun, 06 Jun 2004 13:03:24 GMT  
 Automatically acknowledging links between projects
Try the Activeproject.AcceptNewExternalData property. This should do
what you want.
--
Brian K
MS Project MVP


Mon, 07 Jun 2004 01:51:27 GMT  
 Automatically acknowledging links between projects
If all the suggested methods fail to suppress the dialog, use the dirty way
as  last resort- include the following statement before the FileOpen
statement:
    SendKeys "%c"

I think the statement  [Application.LinksBetweenProjects (True)] should by
itself suppress the dialog

Regards
Venkata Krishna
MCSD



Quote:
> Try the Activeproject.AcceptNewExternalData property. This should do
> what you want.
> --
> Brian K
> MS Project MVP



Tue, 08 Jun 2004 11:40:24 GMT  
 Automatically acknowledging links between projects
I did finally get this to work; however, it is not quite what I wanted.

The OptionsView statement does not seem to do anything. With just this line,
Project still asks about accepting links.

When I inserted the SendKeys line it closes the window. Luckily ALT-C does
not seem to do anything to Project if the external links window does not
open (meaning the project being opened does not have any cross project
links).

I'm guessing the OptionsView command acts immediatly on Project. The
FileOpen command; however, opens the Project file with the Project's
currently set options, not the options I am trying to set.

I was hoping to get both of these in a with statement to see if that would
do both at the same time, but never got the syntax quite right.

    OptionsView CrossProjectLinksInfo:=False, AcceptNewExternalData:=True
    SendKeys "%{C}"
    FileOpen Name:="\\Fox-coc02-bdc\projsched\HPS Control and
IO\FCP270.mpp", _
        ReadOnly:=True, FormatID:="MSProject.MPP", _
        OpenPool:=pjDoNotOpenPool

--
Mike


Quote:
> If all the suggested methods fail to suppress the dialog, use the dirty
way
> as  last resort- include the following statement before the FileOpen
> statement:
>     SendKeys "%c"

> I think the statement  [Application.LinksBetweenProjects (True)] should by
> itself suppress the dialog

> Regards
> Venkata Krishna
> MCSD



> > Try the Activeproject.AcceptNewExternalData property. This should do
> > what you want.
> > --
> > Brian K
> > MS Project MVP



Sat, 12 Jun 2004 02:52:23 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Delete link and recreate link automatically

2. Automatically update links in Excel w/o prompting

3. Automatically Link Tables

4. Automatically Linking a Word Document to Journal Entry

5. Automatically send email by Outlook 2002 from Project 2002

6. Linking Durations to Update Automatically

7. Creating Individual Project Files Automatically

8. Modify Word Graphic Link Automatically

9. Tool for automatically generating html links for whole website directory tree

10. Automatically Assign a Project #

11. Updating linked tables automatically.

12. VB6 not automatically reloading last project

 

 
Powered by phpBB® Forum Software