Freeze Panes from Access
Results 1 to 3 of 3

Thread: Freeze Panes from Access
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Jul 2009
    Posts
    1,570
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Freeze Panes from Access

    I'm building a Excel Workbook from Access after setting a new Excel.Application.

    Set ws= objExcelApp.Workbooks.Open(Myfile).Sheets(1)

    With this I am able to use methods ws.cells, ws.columns etc.

    I would like to freeze the top row of sheets(1) but haven't been able to figure it out.
    In Excel this would be
    Code:
    Range("A2").Select
    ActiveWindow.FreezePanes= true
    I am able to select the range of my Excel object, but would need some other way to FreezePanes.
    Does anyone know if this is possible ?

  2. #2
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling, Scotland
    Posts
    75,121
    Post Thanks / Like
    Mentioned
    60 Post(s)
    Tagged
    6 Thread(s)

    Default Re: Freeze Panes from Access

    Have you tried using objExcelApp?
    Code:
    objExcelApp.ActiveWindow.FreezePanes = True
    PS You should probably use objExcelApp to select the cell and include worksheet/workbook references.
    If posting code please use code tags.

  3. #3
    Board Regular
    Join Date
    Jul 2009
    Posts
    1,570
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Freeze Panes from Access

    Many thanks Norie that did it nicely. Not sure if I'm using objExcelApp as you suggest. I have
    Code:
     Set objExcelApp = CreateObject("Excel.Application")
     Set wb = objExcelApp.Workbooks.Open(Fullpath & Me.Code & ".xlsx")
     Set ws = wb.Sheets(1)
     With ws
    ...

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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