+ Reply to Thread
Results 1 to 3 of 3

ActiveWindow VBA problem

Hybrid View

  1. #1
    Tomasz Klim
    Guest

    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. #2
    Chip Pearson
    Guest

    Re: 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" <[email protected]> wrote in message
    news:%[email protected]...
    >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. #3
    Tomasz Klim
    Guest

    Re: 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" <[email protected]> napisał w wiadomości
    news:[email protected]...
    > 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" <[email protected]> wrote in message
    > news:%[email protected]...
    >>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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1