Early binding can be done with Excel 5.0 and 7.0 by taking advantageof two bugs in Excel. The first bug cannot do direct early binding. Thesecond bug is an unexposed bug in which to do early binding. Be forewarnedthat using this method may not be compatible in future versions of Excel.Follow these steps to early bind with the Excel object:
[Dim|Private|Public|Global] objXLRoot _ as [_ExcelApplication][Dim|Private|Public|Global] objXLApp as Excel.Application
Set objXLRoot = New [_ExcelApplication]
Private Sub Command2_Click() Dim objXL As Excel.Application Dim objXLRoot As [_ExcelApplication] Dim objWKB As Excel.Workbook Set objXLRoot = New [_ExcelApplication] Set objXL = objXLRoot.Application objXL.Visible = True Set objWKB = objXL.Workbooks.Add objWKB.Worksheets(1).Range("A2").Formula = "Hello" objWKB.Parent.ActiveCell.Formula = "Why"End Sub
About Our Editorial Process
At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.
See our full editorial policy.
About Our Journalist
Charlie Frank
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
View Author