Step 3: The selected columns get frozen in its position & it is denoted by a grey line. We need to select the freeze panes command on the view tab. ![]() While the code here is VBA, it should be directly transcribable to other languages and platforms. Step 2: After selecting the columns, we need to click on the view tab on the ribbon. The core process is really just a reiteration of previously submitted answers but I thought it was important to demonstrate how to deal with ActiveWindow when you are not within Excel's own VBA. SaveAs FileName:=fn, FileFormat:=xlOpenXMLWorkbook If CBool(Len(Dir(fn, vbNormal))) Then Kill fn 'This is where the Freeze Pane is dealt withįn = CurrentProject.Path & "\Reports\Report_" & Format(Date, "yyyymmdd") & ".xlsx" Set xlApp = CreateObject("Excel.Application") ![]() Option Explicitĭim xlApp As Excel.Application, ws As Worksheet, wb As Workbook Using the Excel.Application object in another Office application's VBA project will require you to add Microsoft Excel 15.0 Object library (or equivalent for your own version). S own VBA, the ActiveWindow property must be addressed as a child of the Excel.Application object.Įxample for creating an Excel workbook from Access: To expand this question into the realm of use outside of Excel
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |