Hey all I have the following code thats throwing Late bindings.
I thought putting:
Dim excelWS As Worksheet
excelWS = New Worksheet
Before using the variable corrected the late binding issue?
UPDATE 1
Would it be something like this?
Dim excelRange As Range
Dim excelApp As Application
Dim excelWB As Workbook
Dim excelWS As Worksheets
excelWB = New Workbook
If madeSheet = False Then
excelApp = New Application
excelWB = excelApp.Workbooks.Add
excelApp.Visible = True
End If
excelWS = New Worksheet
UPDATE 2
On this line now:
excelWS = excelWB.Worksheets.Add(After:=excelWB.Worksheets(sheetLoops))
I am getting the error of:
Additional information: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Interop.Excel.Worksheets'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{000208B1-0000-0000-C000-000000000046}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).