Questions tagged [ole-automation]

OLE-Automation is a Microsoft COM based technology that allows one application to control another via an exposed public interface.

103 questions
60
votes
9 answers

What does the Excel range.Rows property really do?

OK, I am finishing up an add-on project for a legacy Excel-VBA application, and I have once again run up against the conundrum of the mysterious range.Rows (?) and worksheet.Rows properties. Does anyone know what these properties really do and…
RBarryYoung
  • 55,398
  • 14
  • 96
  • 137
12
votes
3 answers

.NET DateTime, different resolution when converting to and from OADate?

I'm converting a DateTime to OADate. I was expecting to get the exact same DateTime when converting the OADate back, but now it has only millisecond resolution, and is therefore different. var a = DateTime.UtcNow; double oadate = a.ToOADate(); var b…
Ezombort
  • 1,892
  • 3
  • 16
  • 20
10
votes
4 answers

Converting Timespan to DateTime in C#

I am reading Excel worksheet data using C# and Microsoft.Office.Interop. The sheet contains some date values. When I am trying to read that value it is just giving the number (probably TimeSpan). I am having problem converting this number into…
IrfanRaza
  • 3,030
  • 17
  • 64
  • 89
9
votes
3 answers

Is it possible to automate a Click-to-run application?

I have a small application which automates Microsoft Word via COM/OLE Automation. Unfortunately this doesn't work with the virtualized Click-to-run editions of Word, because they don't have the required keys in the registry. (At least not where they…
Daniel Rikowski
  • 71,375
  • 57
  • 251
  • 329
8
votes
4 answers

Is there OLE Automation in Java?

Is it possible to use OLE Automation in Java? If not, why is it not possible in Java? I'm looking to automate the exporting of excel spreadsheets in different format (ie, .csv etc...) Thanks for the answers in advance :)
Shahab
  • 1,977
  • 6
  • 24
  • 28
6
votes
0 answers

Why when trying to assign to a variant, an array for some non-IDispatch-exposing object type, is the array pointer assigned instead?

Summary After declaring an array for some object type where the type doesn't use an interface that derives from COM's IDispatch interface (& so isn't properly set-up to enable [OLE] Automation's late-binding technology), trying to assign the array…
6
votes
1 answer

How to identify Ole object Interface?

It's a bit difficult to explain my exact scenario, but I will try: I'm inspecting a DOM interface that was created via late binding, and at some point selecting a range which returns an interfaced OleVariant Element (this I know for sure). I was…
kobik
  • 21,001
  • 4
  • 61
  • 121
5
votes
2 answers

IAdviseSink setup for catching MSWord document events

Here is the code where I try to setup IAdviseSink interface implemented in my TForm1 class for catching some events of the newly created MSWord document. I have not any errors while the code runs, but I can't catch any event, while save the document…
5
votes
4 answers

Is it possible to generate .docx files without having MS Word installed?

I want to use "OLE automation" (or whatever it's called now) to generate a Word document. I assume that it's possible to perform the following programmatically: Set page size (height, width, margin vals) Set font type/name, style, and size Add page…
5
votes
1 answer

Accessing the Fields collection in Word by using Delphi

I have a small method which is trying to enumerate the fields in a Word document. A lot of time has passed since I had to do this kind of thing and now I can't remember how to do it properly. The code below is using OleVariants, I've been trying for…
Andrea Raimondi
  • 527
  • 8
  • 30
4
votes
1 answer

OLE Automation to launch MS Word and bring to front

What is the "correct" (recommended) method for connecting to a running instance of MS Word and bringing this application to the front? I am doing something like the following from a VBA app: ... objWord = GetObject ("Word.Application") if (objWord…
Ed Schembor
  • 8,090
  • 8
  • 31
  • 37
4
votes
0 answers

Passing a COM object from C# to Perl using PerlNET

I’m trying to pass a COM object from C# code to Perl. At the moment I’m wrapping my Perl code with PerlNET (PDK 9.4; ActiveState) and I have defined a simple subroutine (+ required pod declaration) in Perl to pass objects from C# to the wrapped Perl…
Miriam
  • 41
  • 3
4
votes
1 answer

VBScript: How do I invoke a function which is defined with a vowel in the Dispatch Map

I have following VBScript-Script that creates an Microsoft COM Object. set foo = CreateObject("Bar.ProgId") foo.Einfügen() The implementation of that COM Object is in the Dynamic Link Library Foo.dll which is using the Microsoft Foundation…
kbisang
  • 558
  • 4
  • 13
4
votes
1 answer

How to enable AutoFilter for top row in Excel sheet?

Here is my little test application that produces an Excel 2007 XLSX file: uses Excel2007; function CreateExportExcelWorkbook(AApp: ExcelApplication; ALCID: Integer): ExcelWorkbook; var OldDefaultSaveFormat: XlFileFormat; begin …
Uli Gerhardt
  • 13,748
  • 1
  • 45
  • 83
4
votes
4 answers

From C#, open an arbitrary application

Related question [stackoverflow] here. I'm trying to do the above, but I want to take the process one step further. I want to open an arbitrary file using the default editor for the file type. From that point, I want to allow my user to interact…
Berin
  • 75
  • 1
  • 8
1
2 3 4 5 6 7