Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Win32::OLE and MSProject

by plugNPlay (Initiate)
on Feb 24, 2005 at 16:04 UTC ( [id://434109]=perlquestion: print w/replies, xml ) Need Help??

plugNPlay has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks - Have any of you automated MSProject using Win32::OLE? In particular, have you been able to do GetObject on projects that are saved within Project databases? If a standalone Project file is "bar.mpp", then a Project database can contain several projects: "foo.mpd" will have within it "bar.mpp", "bar2.mpp", etc. How do I access projects within a database? The following code gives a "No such file or directory" error. (Create the directory, database, and file first!)
use strict; use Win32::OLE; my $proj = "<C:\mydir\proj.mpd>\proj.mpp"; my $Object = Win32::OLE->GetObject( $proj ) || die $!;
Many thanks.

Replies are listed 'Best First'.
Re: Win32::OLE and MSProject
by FitTrend (Pilgrim) on Feb 24, 2005 at 16:21 UTC

    If you double quote your windows path using \, you will need to escape them.

    my $proj = "C:\\mydir\\proj.mpd\\proj.mpp";
    or
    my $proj = 'C:\mydir\proj.mpd\proj.mpp';
      That's getting me somewhere. Thanks M a r c!
Re: Win32::OLE and MSProject
by esskar (Deacon) on Feb 24, 2005 at 16:21 UTC
    i'm not sure but try
    my $Object = Win32::OLE->GetObject("MSProject.Project.4_1")
    for creating the object. then you have to open the database. in FoxPro it is Object.application.FileOpen(...)
    HTH
Re: Win32::OLE and MSProject
by dws (Chancellor) on Feb 25, 2005 at 00:29 UTC
    There's more info on accessing MS Project via OLE using Perl here.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://434109]
Approved by phydeauxarff
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-19 16:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found