ActiveWindow VBA problem

T

Tomasz Klim

I have a simple code, generated by Macro Recorder:

With ActiveWindow
.SplitColumn = 1
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True


I need to execute it from external program in VB6.

When I for example fill a cell, I do:
clsExcel.GetExcel.Sheets("sample").Cells(x,y) = z

But where to bind ActiveWindow object? I tried several
possibilities, but without success...
 
C

Chip Pearson

Try

With clsExcel.GetExcel.ActiveWindow
.SplitColumn = 1
.SplitRow = 1
End With

This assumes that the GetExcel method of your clsExcel object
returns a reference to the Excel Application object.

--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
T

Tomasz Klim

Of course it works. But what, if I have several sheets in a workbook, and I
want to do in on selected sheet, instead of active sheet?
 

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

Top