Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Fri Mar 2 18:26:09 CST 2007
Jim: I had the wrong object. I was using the worksheet objXLS instead of the application objXLApp. This worked: objXLS.Rows("2:2").Select objXLApp.ActiveWindow.FreezePanes = True Thanks for all the input. Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Moss Sent: Friday, March 02, 2007 3:46 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Freeze Panes Rocky, If you set an freezepane on row 2 and an autofilter on row 1, you can lock a value in column 1 with the autofilter which is sorta like what you are trying to do. Jim > Jim: > > If I do it: > > objXLS.Rows("2:2").Select > objXLS.ActiveSheet.FreezePanes = True > > Or > > objXLS.Rows("2:2").Select > objXLS.ActiveWindow.FreezePanes = True > > It won't compile. > > The objects are set: > > Dim objXLApp As Excel.Application > Dim objXLS As Excel.Worksheet > > Set objXLApp = New Excel.Application > Set objXLS = objXLApp.ActiveSheet > > And some other formatting works OK. > > Any idea what I'm doing wrong? > > Thanks > > Rocky > > > > > > > > -----Original Message----- > From: accessd-bounces at databaseadvisors.com > [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Moss > Sent: Friday, March 02, 2007 2:07 PM > To: Access Developers discussion and problem solving > Subject: Re: [AccessD] Freeze Panes > > Rocky, > > The .rows should come immediately before the freezepanes. I believe > that the compiler is getting hung up on your range statement > > Jim > >> Jim: >> The problem is the next line which won't compile. So I can't even >> test the Rows statement. :( >> >> Rocky >> >> -----Original Message----- >> From: accessd-bounces at databaseadvisors.com >> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Moss >> Sent: Friday, March 02, 2007 12:03 PM >> To: Access Developers discussion and problem solving >> Subject: Re: [AccessD] Freeze Panes >> >> Rocky, >> >> I think that you probably need a .rows statement before the >> freezepanes statement, like: >> objSht.Rows("3:3").select or a columns if you aren't trying to >> freeze the sheet below the title line >> >> Jim >> >>> Charlotte: >>> >>> When I change the line to: >>> >>> objXLS.ActiveSheet.FreezePanes = True >>> >>> Then I get the same error but on ActiveSheet instead of FreezePanes. >>> >>> Rocky >>> >>> -----Original Message----- >>> From: accessd-bounces at databaseadvisors.com >>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte >>> Foust >>> Sent: Friday, March 02, 2007 10:46 AM >>> To: Access Developers discussion and problem solving >>> Subject: Re: [AccessD] Freeze Panes >>> >>> Off the top of my head, shouldn't it be ActiveSheet? >>> >>> Charlotte Foust >>> >>> -----Original Message----- >>> From: accessd-bounces at databaseadvisors.com >>> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky >>> Smolin at Beach Access Software >>> Sent: Friday, March 02, 2007 10:20 AM >>> To: 'Access Developers discussion and problem solving' >>> Subject: [AccessD] Freeze Panes >>> >>> Dear List: >>> >>> I am trying to do a Freeze Panes on an Excel spreadsheet I create in >>> an access app. But I can't seem to get the code right. I'm using: >>> >>> objXLS.Range("B2").Select >>> objXLS.ActiveWindow.FreezePanes = True >>> >>> but the compiler doesn't like ActiveWindow, says Method or Data >>> Member not found. >>> >>> There's a bunch of other formatting that's working OK. Mostly >>> cribbed from recording macros in Excel. >>> >>> Does anyone know offhand the correct syntax for freezing the panes? >>> >>> MTIA >>> >>> Rocky >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >>> -- >>> No virus found in this incoming message. >>> Checked by AVG Free Edition. >>> Version: 7.5.446 / Virus Database: 268.18.5/707 - Release Date: >>> 3/1/2007 >>> 2:43 PM >>> >>> >>> -- >>> AccessD mailing list >>> AccessD at databaseadvisors.com >>> http://databaseadvisors.com/mailman/listinfo/accessd >>> Website: http://www.databaseadvisors.com >>> >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> >> -- >> No virus found in this incoming message. >> Checked by AVG Free Edition. >> Version: 7.5.446 / Virus Database: 268.18.5/707 - Release Date: >> 3/1/2007 >> 2:43 PM >> >> >> -- >> AccessD mailing list >> AccessD at databaseadvisors.com >> http://databaseadvisors.com/mailman/listinfo/accessd >> Website: http://www.databaseadvisors.com >> > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > > -- > No virus found in this incoming message. > Checked by AVG Free Edition. > Version: 7.5.446 / Virus Database: 268.18.5/707 - Release Date: > 3/1/2007 > 2:43 PM > > > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.5/707 - Release Date: 3/1/2007 2:43 PM