Jim Moss
jim.moss at jlmoss.net
Fri Mar 2 12:47:34 CST 2007
Rocky, Your Freezepanes statement looks like mine, which compiles and runs. I build a lot of excel files and basically this is used a lot see snippet: With objXL .Visible = False Set objWkb = .Workbooks.Add Set objSht = objWkb.Worksheets(1) With objSht On Error Resume Next .range(.cells(3, 1), .cells(intMaxRow, _ intMaxCol)).CopyFromRecordset rs1 End With End With End If objSht.cells(2, 1).formular1c1 = "SupplierName" objSht.cells(2, 2).select objSht.cells(2, 2).formular1c1 = "InvoiceNumber" objSht.cells(2, 3).select objSht.cells(2, 3).formular1c1 = "RemainingAmount" objSht.cells(2, 4).select objSht.cells(2, 4).formular1c1 = "DueDate" objSht.cells(2, 5).select objSht.cells(2, 5).formular1c1 = "PONumber" objSht.cells(2, 6).select objSht.cells(2, 6).formular1c1 = "Location" objSht.cells(2, 7).select objSht.cells(2, 7).formular1c1 = "ERP" objSht.cells(2, 8).select objSht.cells(2, 8).formular1c1 = "HoldStatus" objSht.cells(2, 9).select objSht.cells(2, 9).formular1c1 = "DateTime User ID Notes DM Status" objSht.cells(2, 10).select objSht.cells(2, 10).formular1c1 = "" objSht.range("A1").select objSht.Rows("1:1").RowHeight = 51 objSht.Columns("A:A").ColumnWidth = 17.57 objSht.Pictures.Insert("\\p821srv\org\Acct\IC_Data\Graphics\SanminaShadowLogo.bmp").select objSht.Columns("A:A").ColumnWidth = 9.71 objSht.Columns("A:A").ColumnWidth = 9.43 objSht.range("B1").select objSht.cells(1, 2).formular1c1 = "AP Invoices" With objSht.cells(1, 2).Characters(start:=1, Length:=11).Font .Name = "Arial" .FontStyle = "Bold" .Size = 14 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False '.Underline = xlUnderlineStyleNone '.ColorIndex = xlAutomatic End With objSht.Rows("2:2").AutoFilter objSht.Rows("2:2").Interior.ColorIndex = 19 'objSht.Rows("2:2").Interior.Pattern = solid objSht.Rows("3:3").select ' objXL.ActiveWindow.FreezePanes = True =========================================================================== end snippet: Jim > 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 >