ole

How to do a simple mail merge in OpenOffice

I need to do a simple mail merge in OpenOffice using C++, VBScript, VB.Net or C# via OLE or native API. Are there any good examples available? ...

Why would the Win32 OleGetClipboard() function return CLIPBRD_E_CANT_OPEN?

Under what circumstances will the Win32 API function OleGetClipboard() fail and return CLIPBRD_E_CANT_OPEN? More background: I am assisting with a Firefox bug fix. Details here: bug 444800 - cannot retrieve image data from clipboard in lossless format In the automated test that I helped write, we see that OleGetClipboard() sometimes...

Why do I need OleDbCommand.Prepare()?

I'm working with a datagrid and adapter that correspond with an MSAccess table through a stored query (named "UpdatePaid", 3 paramaters as shown below) like so: OleDbCommand odc = new OleDbCommand("UpdatePaid", connection); OleDbParameter param; odc.CommandType = CommandType.StoredProcedure; param = odc.Parameters.Add...

Excel automation via OLE - suppressing / catching dialog box errors?

I refresh Excel 2007 data connections via a C# program and OLE. Most of the work is done by a single Workbooks.RefreshAll() statement. As is the nature of refreshing spreadsheets, various things can go wrong. During the refresh process, the program can give dialog box error messages about "Data cannot be read from file '|'", and a messa...

OLE Client in SDI. Want to add a toolbar

I have an SDI that I'm loading Excel into using OLE. I want to add a toolbar to this that I can use to have a very prominent and evident "import" button (and a few others). The toolbars I add through MFC are all hidden or otherwise removed from the interface when Excel becomes active. Is there a way to keep a toolbar up and on the inte...

How to call COM function from PHP with OLE_COLOR as an argument?

I am trying to call a COM object from PHP using the COM interop extension. One function requires an OLE_COLOR as an argument? Is there any way to pass this kind of value from PHP? I have tried passing a simple integer value with no success. $this->oBuilder->Font->Color = 255; ...

Need ActiveX control to embed Excel into a dialog

I'm building an "import from Excel" function. It has to be in a DLL, called from a non-MFC app. Has to provide an image of the spreadsheet that users can drag a select box around (to select cells), then click an IMPORT button, and have the right thing happen. Having trouble getting the spreadsheet up, having a button adjacent to it, an...

How would I do TDD with a COM OLE object

I have an OLE COM object that trying to write a wrapper for, I have decided to start to use TDD to write the code for it as I believe that it will give me a better sense of direction with what I'm try to write. The COM object has a interface like this: Interface Mapinfo Sub [Do](ByVal cmd As String) Function Eval(ByVal cmd As S...

CoCreateInstance fails for class Microsoft_Office Excel Worksheet. 0x80040514 "Class not registered"

A sample I'm working on calls CoCreateInstance for class Microsoft_Office Excel Worksheet. It fails with HRESULT of 0x80040514 ("Class not registered"). Other Excel classes (Excel.Application) are registered on the system, but not the one for Worksheet .....Is it possible to register this class? Update: I'm using Microsoft's DSOFram...

How do I create an OLE Control ?

Without going into why I need OLE.. I need to embed a managed C++ custom control into MS Word 2007 (2003 also would be nice). So the question is How do I make this managed (.net 3.5) control OLE compliant ? It seems that I need to do something akin to implementing an interface. But an up-to-date tutorial is something that is proving d...

0x800a03ec when calling Select on an Excel range (IRange). Range was returned from the worksheet's usedrange.

I'm trying to select the "used range". I get the worksheet's UsedRange, then I invoke the Select function on it. I receive HRESULT 0x800a03ec on the select call. Here's the code: COleVariant result; HRESULT hr = AutoWrap(DISPATCH_METHOD, &result, irange, L"Select", 0); I won't bother posting the code for the AutoWrap function (unl...

Excel automation. Need to select multiple items from a Range

I have code that lets me select a single item in arange: COleVariant vItems = cstrAddr; hr = AutoWrap( DISPATCH_PROPERTYGET, &vCell, irange, L"Item", 2, COleVariant((short)(1)), COleVariant((short)(1))); if (FAILED(hr)) return hr; // Use the dispatch interface to select ...

How do I script an OLE component using Python?

I would like to use Python to script an application that advertises itself as providing an OLE component. How should I get started? I don't yet know what methods I need to call on the COMponents I will be accessing. Should I use win32com to load those components, and then start pressing 'tab' in IPython? ...

Set OLE Request Timeout from C++

I am instantiating a local COM server using CoCreateInstance. Sometimes the application providing the server takes a long time to start. When this happens, Windows pops a dialog box like this: Server Busy The action cannot be completed because the other program is busy. Choose 'Switch To' to activate the busy program and correct the ...

ole excel object manipulation causes run-time error '91'

I am maintaining an application that was written in VB6 and makes use of the several OLE controls with Excel.Sheet.8 class objects. Several users are getting the "Run-time error '91': Object variable or With block variable not set" error when they reach a point in code that attempts to manipulate the excel objects. Below are examples of ...

ole excel objects in VB6

Is anyone aware of a good resource online for detailed information on the use of ole excel objects(embeded workbooks, worksheets, etc...) in VB6? I'm maintaining an application that makes heavy use of these conrols and I'm having a lot of trouble getting them to work properly for the user's of this program. The scattered bits of Q&A I ca...

Populate Excel with data from LINQ to SQL query.

I am trying to send some data from a LINQ query in C# to an Excel speed sheet using OLE I have a query like this: Var data = from d in db.{MyTable} where d.Name = "Test" select d; I have the Excel OLE object working fine, I just can't figure out how to populate the cells in Excel with the data from the LINQ quer...

Implementing IInternetZoneManager in .NET

I'm trying to implement IInternetZoneManager in .NET with Webbrowser Control but I have no clue what to do. I couldn't find any managed code example about this implementation. I'm pretty bad about OLE stuff. Can anyone provide a sample on this? I spend about 2 days with no luck. ...

Why can't Win32::OLE talk to Excel2003 under Win2003?

I have a Web-based Perl Win32::OLE script that uses Excel on the server side. It has been working happily for years on a Win2000 server running Excel2000. We recently upgraded to Win2003/Excel2003 and I now get the following error from the script: Win32::OLE(0.1709) error 0x80070005: "Access is denied" at create_worksheet_lib.plx line ...

How Do I Bypass MS Access Startup When Using OLE?

I am trying to do an automated xml export from an access database using C# and OLE. Everything is working perfectly except that the startup form is shown and won't close without user intervention. Here's what I am doing so far: objAccess = CreateObject("Access.Application"); objAccess.OpenCurrentDatabase("C:\\MYDB.mdb", true); //true ...