Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ActiveWindow VBA problem

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...


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default ActiveWindow VBA problem

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


"Tomasz Klim" wrote in message
...
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...




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default ActiveWindow VBA problem

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?


Użytkownik "Chip Pearson" napisał w wiadomo¶ci
...
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


"Tomasz Klim" wrote in message
...
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...






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to iterate through sheets and set ActiveWindow [email protected] Excel Programming 2 February 24th 06 10:32 PM
VBA ActiveWindow.WindowState Problem JK Excel Programming 2 February 3rd 05 01:21 AM
Problem with using the ActiveWindow property - sometimes Ragnar Midtskogen Excel Programming 1 November 24th 04 02:37 PM
ActiveWindow.ScrollColumn Sort hotherps[_102_] Excel Programming 1 August 13th 04 02:27 PM
Using ActiveWindow.PointsToScreenPixelsY Pancho Excel Programming 5 February 7th 04 11:23 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"