We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Option Compare Database Option Explicit Sub test() 'dear Experts Exchange experts, kindly try to change the compiler constant between "Late" and "Early2007" #Const ExcelBindingAndVersion = "Late" '"Early2003" or "Early2007" or "Late" #If ExcelBindingAndVersion = "Early2003" Or ExcelBindingAndVersion = "Early2007" Then 'early binding for 2003 and 2007 Dim xlsApp As Excel.Application Dim xlsWbk As Excel.Workbook Dim xlsWst As Excel.Worksheet Set xlsApp = New Excel.Application #ElseIf ExcelBindingAndVersion = "Late" Then 'late binding Dim xlsApp As Object 'excel object Dim xlsWbk As Object 'excel object Dim xlsWst As Object 'excel object Set xlsApp = VBA.CreateObject("Excel.Application") #End If Set xlsWbk = xlsApp.Workbooks.Add Set xlsWst = xlsWbk.Worksheets(1) With xlsWst.Sort .SetRange xlsWst.Range("A1:A5") .Header = xlYes .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With Set xlsWst = Nothing Set xlsWbk = Nothing xlsApp.Quit Set xlsApp = Nothing Stop 'at this point in time, if i used early binding and i open task manager, there will be NO excel processes running 'however if i use late binding i'll still have an excel process running. 'this Excel process "unwilling to die" only happens after running the sort code End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|Linking Child/Parent fields between 2 subforms||15||61|
|print previewing the record showing on the form||4||53|
|Access 2016 Query to text file csv makes my computer do the blue screen of death||4||17|
|MS Access How To Code In VBA Current Computers Name Instead of Hardcoding it||5||24|
Join the community of 500,000 technology professionals and ask your questions.