Questions tagged [win32ole]

Object Linking and Embedding (OLE) is a proprietary interface to Microsoft applications. Most notably the Microsoft Office suite.

Object Linking and Embedding is an API provided by Microsoft to allow for control operations with Microsoft Applications.

Perl can make use of this API using the Win32::OLE module. Ruby also has a WIN32OLE class which does much the same.

However the primary scripting language is VBA, and Microsoft supply a variety of examples via MSDN

May be synonymous with the OLE tag, although anyone specifying Win32::OLE (or WIN32OLE) is probably specifically using Ruby or Perl.

Ref: Wikipedia:OLE

213 questions
3
votes
3 answers

How do I disable exp/lib generation when building an exe?

I realize this is probably caused by some _dllexport() somewhere, not in my code but in some third-party piece. (Qt, Boost, OpenSG, ...) Is there a simple linker option to disable this? I've searched but not found anywhere.
Macke
  • 24,812
  • 7
  • 82
  • 118
3
votes
1 answer

Ruby (Shoes) List box crash when populating from excel

I've got a problem when using Shoes. I'm basically trying to open an excel document and pass the names of the worksheets to a list_box. The following method is called on a button press after selecting a file. (This all works and the file opens) exc…
DurkD
  • 169
  • 2
  • 8
3
votes
1 answer

Win32::OLE - Word: How to move around in tables?

#!C:\Perl\bin\perl.exe use warnings; use 5.012; use Win32::OLE; use Win32::OLE::Const 'Microsoft Word'; $Win32::OLE::Warn = 3; my $word; eval{ $word = Win32::OLE->GetActiveObject( 'Word.Application' ); }; die 'Word not Installed' if $@; if ( not…
sid_com
  • 24,137
  • 26
  • 96
  • 187
3
votes
2 answers

How to Extract text from MS Word?

I'm trying to open a word document and just extract all the text that is in the document and display it to the user using Win32::OLE #usr/bin/perl #OLEWord.pl #Use string and print warnings use strict;use warnings; #Using OLE + OLE constants for…
Shahab
  • 1,977
  • 6
  • 24
  • 28
3
votes
1 answer

How can I use WIN32OLE safely from a rails app?

I'm trying to use the win32ole gem in a Rails 3 app and running into some problems that I think are thread-related. Basically, I have code like this that I use to get user-specific data from our Active Directory store: root =…
Ben
  • 1,321
  • 15
  • 30
3
votes
0 answers

How do I debug scripts that use win32ole?

How do I debug scripts that use win32ole? For example, I found via trial and error that the following Ruby script doesn't work because excessively_long_range is too long: require "win32ole" # Boring initialization stuff excel =…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
3
votes
1 answer

What is the difference between Ruby win32api and win32ole?

A piece of ruby code using win32ole require 'win32ole' ie = WIN32OLE.new('InternetExplorer.Application') ie.visible = true ie.gohome Some code using win32api require "Win32API" message = "This is a sample Windows message box generated using…
vishless
  • 829
  • 1
  • 5
  • 28
3
votes
2 answers

How do I apply formatting to a particular word in a docx file using Win32::Ole in Perl?

For example, my docx file contains the following sentences: This is a Perl example This is a Python example This is another Perl example I want to apply bold style to all the occurrences of the word "Perl" like so: This is a Perl example This is a…
Mike
  • 1,841
  • 5
  • 24
  • 34
3
votes
0 answers

How should I implement IDownloadProgressChangedCallback using WIN32OLE?

I'd like to download Windows updates by use of WIN32OLE in Ruby. I'm running into issues knowing which COM object to use in order to get the arguments needed by IUpdateDownloader::BeginDownload . For the time being, I can execute the synchronous…
Ci3
  • 4,632
  • 10
  • 34
  • 44
3
votes
1 answer

Register a proxy/stub in HKEY_CURRENT_USER

The MIDL compiler generates code for a proxy/stub with registration routines that write to HKEY_LOCAL_MACHINE. Is there any way (preferably without hacking the MIDL-generated code and without bypassing all that generated code in favor of custom…
Michael Gunter
  • 12,528
  • 1
  • 24
  • 58
3
votes
1 answer

How can I run Win32OLE calls from ubuntu?

I have some simple sinatra apps that make use of the OTA COM dll for talking to Quality Center. I want to move those sites into docker images, so I can host them on my docker server. It occurred to me that theoretically I should be able to get…
Nigel Thorne
  • 21,158
  • 3
  • 35
  • 51
3
votes
2 answers

Word Automation using WIN32OLE

I am trying to insert an image (jpg) in to a word document and the Selection.InlineShapes.AddPicture does not seem to be supported by win32old or I am doing something wrong. Has anyone had any luck inserting images.
Luke
3
votes
0 answers

windows automation with ruby win32ole - access an enum

accessing methods and properties from ruby win32ole gem seems easy, but what do I do when I have to set an enum more specifically, i am trying to set one of the values defined by warningLevelOption defined for VCProjectEngine but nothing seems…
Dan
  • 397
  • 1
  • 3
  • 9
3
votes
2 answers

Problems reading a .xls file using Perl Win32::OLE under Cygwin

I have been fighting with this one for two days, I cannot find the solution and I'm getting frustrated. While using the code below under Cygwin I get this error OLE exception from "Microsoft Office Excel": Excel cannot access 'Empty.xls'. The…
user1513756
  • 31
  • 1
  • 2
2
votes
1 answer

Automatically Confirming a Msgbox in Excel VBA code

I am using ruby a WIN32OLE to automate execution of Excel macros with windows scheduler. I have all of this working properly. My problem comes with having to run a macro embedded in an excel file of an external party (ie I don't have control of the…
Pynner
  • 1,007
  • 10
  • 22
1
2
3
14 15