473,545 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Win32::OLE, Excel, and coloring

Hello,

I've been using ActiveState's ActivePerl to generate Excel
spreadsheets using the Win32::OLE module. The rudimentary examples
that are out there on the web show the way to set up specific ranges
and enter data into cells, but what I'm looking for at this point is
how to set the background color of cells.

Does anybody know how to do this with Win32::OLE? If this module maps
to Microsoft's API, is there any complete documentation out there
about which hash keys inside of range or cell objects map to which
features in the application?

Any help would be appreciated.
Jul 19 '05 #1
1 13090
md*@idatar.com (M. David Allen) wrote:

: I've been using ActiveState's ActivePerl to generate Excel
: spreadsheets using the Win32::OLE module. The rudimentary examples
: that are out there on the web show the way to set up specific ranges
: and enter data into cells, but what I'm looking for at this point is
: how to set the background color of cells.
:
: Does anybody know how to do this with Win32::OLE?

# $range is a Range object within a Worksheet object
$range->Interior->{ColorIndex} = 6; # 6 == yellow

: If this module maps to Microsoft's API,

The application's class is the interface. Win32::OLE just gives Perl
access to the class.

: is there any complete documentation out there
: about which hash keys inside of range or cell objects map to which
: features in the application?

Objects, their methods, and their properties are described in the
Excel VBA documentation. All you have to do is mentally alter VBA
syntax into Perl syntax--the Synopsis section of the Win32::OLE pod
gives good clues on that.

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6166
by: usenet | last post by:
Problem installing Win32::OLE under Cygwin. I have searched the web and found little documentation on installation procedure. Please help. I'd like to get Win32::OLE working under cygwin. Cygwin perl 5.8.6-4 Windows XP SP1
3
41768
by: sandycat05 | last post by:
Hello all, I am a new Perl programmer. Below is the beginnings of a code that I am using to manipulate an Excel spreadsheet via Perl using win32::OLE. However, what I'd like to do is the following: instead of either opening a file or creating a new one, I'd like to do BOTH. I was thinking of creating a loop where I could basically say something...
2
2984
by: medak | last post by:
Hi, I am trying to automate internet explorer using Active Perl’s Win32::OLE Module I know that WithEvents(OBJECT]method enables and disables the firing of events by the specified OBJECT. And the INTERFACE argument in it tells the Win32::OLE module the name of the event interface that an application must implement to receive event...
2
4422
by: momukhtar | last post by:
I am using Win32::OLE to write a perl script which opens an excel file. That excel file is password protected and everytime i run that script dialog box pops up and I have to click on Read-Only then my script executes. Is there any way I can specify the readonly attribute in my code so i dont have to click on read only.
8
36459
by: rssd | last post by:
can somebody help me. I'm trying to read some excel files but i'm always getting this error No type library matching "Microsoft Excel" found at D:\Genes_datasets\exp.pl line 4 Win32::OLE(0.16): GetOleTypeLibObject() Not a Win32::OLE::TypeLib object at C:/Perl/site/lib/Win32/OLE/Const.pm line 45. Died at D:\Genes_datasets\exp.pl line 6. i...
1
6165
by: mohanprasadgutta | last post by:
Hi, I need help to open a password protected excel file in perl using Win32:OLE. when I tried to open file in normal way at the time of program execution it is prompting me to enter password. I am giving the script i used for opening excel file.. So i want to know how to provide password parameter while opening the file. use strict; use...
1
1616
by: Tension | last post by:
Hi, I have written a development automation tool that needs to be distributed to 20-odd developers using Windows XP workstations. Is there a free Perl distribution that includes "Win32::OLE" by default? Best Regards, Adam S
6
6460
by: poolboi | last post by:
hi all, i've got the following program that needs yr help: use Win32::OLE; # use existing instance if Excel is already running eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')}; die "Excel not installed" if $@; unless (defined $ex) {
1
4505
by: user1357 | last post by:
Hi all, i am trying to run the following code use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel';
0
7390
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7647
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7742
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5958
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5318
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3436
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1007
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
692
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.