UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Excel.2016 Freezepanes Does Not Work, Office 2013    
 
   
pacala_ba
post Sep 19 2019, 04:11 AM
Post#1



Posts: 660
Joined: 19-March 09
From: Europe, SLOVAKIA, Bratislava


Hi
it looks like Excel.2016 FreezePanes , needs ActiveWindow iconfused.gif

It works on EXCEL.2013..........OK
CODE
If ObjXL.ActiveWindow.FreezePanes Then ObjXL.ActiveWindow.FreezePanes = False
objWST.ROWS(nRow & ":" & nRow).Select
'---------------------------------------------
ObjXL.ActiveWindow.FreezePanes = True
' ERR =  1004,Unable to set the FreezePanes property of the Window class...!

Also SET_FOREGROUNDWINDOW (if PC locked) , the same Error
/////////
..there is missing Office 2016.....in this Window.Version lightbulb.gif

--------------------
Go to the top of the page
 
DanielPineault
post Sep 19 2019, 08:05 AM
Post#2


UtterAccess VIP
Posts: 6,899
Joined: 30-June 11



I've always done something along the lines of
CODE
            oExcelWrSht.Rows("2:2").Select
            With oExcel.ActiveWindow
                .SplitColumn = 0
                .SplitRow = 1
                .FreezePanes = True
            End With

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
ADezii
post Sep 19 2019, 10:11 AM
Post#3



Posts: 2,674
Joined: 4-February 07
From: USA, Florida, Delray Beach


The following basic Code, using Late Binding should work in that it will set the FreezePanes Property = True on WorkSheet Sheet1 in the Workbook C:\Test\Book1.xlsx:
CODE
'Use Late Binding
Dim oExcel As Object
Dim oWkb As Object
Dim oWks As Object

Set oExcel = CreateObject("Excel.Application")
    oExcel.Visible = True

Set oWkb = oExcel.Workbooks.Open("C:\Test\Book1.xlsx")
Set oWks = oWkb.Worksheets("Sheet1")
    oWks.Activate

oExcel.ActiveWindow.FreezePanes = True
Go to the top of the page
 
pacala_ba
post Sep 20 2019, 10:36 AM
Post#4



Posts: 660
Joined: 19-March 09
From: Europe, SLOVAKIA, Bratislava


Hi, thx
I am using ACCESS.Automation not Excel direkt
it only works ,............. if i set WorkSheet.Hwnd to the Foreground, yayhandclap.gif
otherwise allways error ooo.gif

--------------------
Go to the top of the page
 
pacala_ba
post Sep 24 2019, 05:50 AM
Post#5



Posts: 660
Joined: 19-March 09
From: Europe, SLOVAKIA, Bratislava


Hi
Microsoft-BUG-FREEZEPANE
pullhair.gif pullhair.gif pullhair.gif

--------------------
Go to the top of the page
 
arnelgp
post Sep 24 2019, 06:45 AM
Post#6



Posts: 1,420
Joined: 2-April 09
From: somewhere out there...


if Activewindow is not the workbook you want to work on,
then it will fail.

objXL.Windows("the name of workbook").Activate
If ObjXL.ActiveWindow.FreezePanes Then ObjXL.ActiveWindow.FreezePanes = False
objWST.ROWS(nRow & ":" & nRow).Select

--------------------
Never stop learning, because life never stops teaching.
Go to the top of the page
 
pacala_ba
post Oct 1 2019, 06:06 AM
Post#7



Posts: 660
Joined: 19-March 09
From: Europe, SLOVAKIA, Bratislava


Hi, thx , but..
CODE
if Activewindow is not the workbook you want to work on,
then it will fail.

objXL.Windows("the name of workbook").Activate
If ObjXL.ActiveWindow.FreezePanes Then ObjXL.ActiveWindow.FreezePanes = False
objWST.ROWS(nRow & ":" & nRow).Select


XL.2010 OK,
but XL.2016........FAILURE, MICROSOFT BUG pullhair.gif
CODE
ERR =  1004,Unable to set the FreezePanes property of the Window class

--------------------
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    14th October 2019 - 12:40 AM