Excel question.

R

Richard S Beckett

Guys,

I want to be able to work out how to do things in excel by myself, but I
don't know how to convert between the macro syntax, and that required in
perl modules.

The 3 things I want to do currently are:
1. Make columns Autofit.
2. Merge cells.
3. Freeze panes.

To this end, I recorded a macro. It looks like this...

Sub Macro1()
Columns("A:BX").Select
Columns("A:BX").EntireColumn.AutoFit
ActiveWindow.ScrollColumn = 1
Range("F5:H5").Select
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
Selection.Merge
Range("B2").Select
ActiveWindow.FreezePanes = True
End Sub

How do I get from this to the commands I need to use in either
Spreadsheet::WriteExcel, or Win32::OLE?

Thanks.
 
B

Ben Liddicott

Converting VB to Win32::OLE is easy. The ActiveState documentation contains
several examples.

See under "Using OLE with Perl" in your documentation, which should be
under:
html/faq/Windows/ActivePerl-Winfaq12.html

in your perl installation directory.

Cheers,
Ben Liddicott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,818
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top