Now I seem to have a problem with the Ole does anyone know another solution I am pasting the code I had before
I would greatly appreciate it if someone can help me get this working again any ideas ???
FUNCTION Calendar() AS VOID
// Add event handling code here
/* LOCAL objOL AS OBJECT
LOCAL objNS AS OBJECT
LOCAL objCalendar AS OBJECT
LOCAL objExplorer AS OBJECT
FUNCTION AddOutlookContact() AS VOID
LOCAL outApplication AS Microsoft.Office.Interop.Outlook.Application
*' Get the namespace and the logon.
LOCAL outNamSpace AS Microsoft.Office.Interop.Outlook.NameSpace
*' Create a new contact item.
LOCAL NewContact AS Microsoft.Office.Interop.Outlook.ContactItem
// Create an Outlook application.
// Get the namespace and the logon.
why do you try with OleAutoObject? This is VO code and AFAIK does not works in X#.
You need to rewrite that code (in a much simpler manner) using the Microsoft.Office.Interop.Outlook library, like the one I have posted to your other message.
P.S. it does not helps open up more threads for a similar issue. Open up one and wait until someone is able to help you.
Thanks for your advise will do in future I sent you a reply regarding the first code you sent me I get a compile error do you know the reason I am using exactly what you did only with more fields.
In .Net the recommended way to use com is not to use the oleautoobject class but to use a refernece to the interop library that is created when you add a com reference to your project, or to use a "primary interop assembly", a pre installed interop library that you will find in the first page of add reference dialog.
This approach works much better than the oleautoobject class.
If you look in the turorials in the documentation you should also find an example of how to automate excel that way.
XSharp Development Team
I am finalizing my program to read cells from an Excel spreadsheet. I hope to have it ready tomorrow and I'll publish it here so anyone wanting to do some Office automation should have a good starting point.