Late Binding VB.net with MS Project 98 
Author Message
 Late Binding VB.net with MS Project 98


Quote:
> The following code should work if I have properly
> referenced the MS Project 98 APIs (The MSPROJ8.OLB COM
> component).

> '************************************

> Dim objProjApp As MSProject.Application

> objProjApp = new MSProject.Application
> objProjApp.FileOpen("C:\MyMPPFile.mpp")

> '************************************

> However, I get the following error:

> ------------------------------------
> An unhandled exception of type
> 'System.Runtime.InteropServices.COMException' occurred in
> mscorlib.dll

> Additional information: The argument value is not valid.

> Check that the value is correct and that it is the
> correct type for the argument.

> ------------------------------------

What line of code is generating the error?  Also, use ILDASM on the
generated wrapper assembly to see if you possibly need to define
objProjApp as an interface.

--
Patrick Steele
Microsoft .NET MVP
http://www.*-*-*.com/



Sun, 22 May 2005 02:53:06 GMT  
 Late Binding VB.net with MS Project 98
The error occurs when I get to line:

objProjApp.FileOpen("C:\MyMPPFile.mpp")

I'm speculating that objProjApp does not need an
interface since other method calls can be made that run
successfully such as the line:

objProjApp.AppMaximize()

and setting properties such as the line:

objProjApp.DisplayAlerts = False

This line executes immediately before the FileOpen method
call, and I threw in objProjApp.AppMaximize() just to
test that I was indeed successfully accessing the Project
APIs.  

Just speculating though, the .net world and how it
communicates with "unmanaged code" is still new to me.  I
haven't used ILDASM.  I've read about it, and I'll try to
give it a shot to see what I can find.  I have VS.net
Enterprise Architect so I should have the tool
somewhere...just a matter of finding it! LOL

Quote:
>-----Original Message-----
>In article <074601c29af7$c066aff0


Quote:

>> The following code should work if I have properly
>> referenced the MS Project 98 APIs (The MSPROJ8.OLB COM
>> component).

>> '************************************

>> Dim objProjApp As MSProject.Application

>> objProjApp = new MSProject.Application
>> objProjApp.FileOpen("C:\MyMPPFile.mpp")

>> '************************************

>> However, I get the following error:

>> ------------------------------------
>> An unhandled exception of type
>> 'System.Runtime.InteropServices.COMException' occurred
in
>> mscorlib.dll

>> Additional information: The argument value is not
valid.

>> Check that the value is correct and that it is the
>> correct type for the argument.

>> ------------------------------------

>What line of code is generating the error?  Also, use
ILDASM on the
>generated wrapper assembly to see if you possibly need
to define
>objProjApp as an interface.

>--
>Patrick Steele
>Microsoft .NET MVP
>http://radio.weblogs.com/0110109
>.



Sun, 22 May 2005 04:00:30 GMT  
 Late Binding VB.net with MS Project 98

Quote:
> Just speculating though, the .net world and how it
> communicates with "unmanaged code" is still new to me.  I
> haven't used ILDASM.  I've read about it, and I'll try to
> give it a shot to see what I can find.

Check and see what the return type of MSProject.Application.FileOpen()
as well as what parameters is accepts.

--
Patrick Steele
Microsoft .NET MVP
http://radio.weblogs.com/0110109



Mon, 23 May 2005 04:22:20 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MS Project 98 vs Ms Project 2000

2. Using MS Access 97 to Create and Manage MS Project 98

3. Saving data in MS Project 98 to MS Access

4. Opening MS Project 98 plan from Excel 97 vb code

5. VB ActiveX dll integrated with MS Project 98

6. Late Binding - VB and MS Word

7. ASP.NET update task in MS Project Server and MS Project

8. TOUGH Question - Late Bound COM objects and VB.NET

9. Problems with parameters and late-binding in VB.NET

10. MS Access and Project 98

11. MS Project 98/2000 and Visual Basic 6.0

12. MS Project 98 ClassName

 

 
Powered by phpBB® Forum Software