I have found this code to export an unbound textbox to an excel spreadsheet cell but am recieving the error "Run-time error '429': ActiveX component can't create object".
Here is the code:
I believe I have all the references required...any ideas?
Here is the code:
Code:
Private Sub Command294_Click()
Dim XLApp As Excel.Application
Dim wrkWorkbook As Excel.Workbook
Dim wrkSheet As Excel.Worksheet
Set XLApp = CreateObject("Excel.Application")
XLApp.Workbooks.Open ("c:\damontest.xlsx")
Set wrkWorkbook = XLApp.ActiveWorkbook
Set wrkSheet = wrkWorkbook.ActiveSheet
XLApp.Visible = False
wrkSheet.Range("A1").Select
Me.TxtTotalUsageToDateFiscalSME.SetFocus
Selection = TxtTotalUsageToDateFiscalSME.text <-----FAILS HERE
wrkWorkbook.Close True
Set wrkSheet = Nothing
Set wrkWorkbook = Nothing
Set XLApp = Nothing
End Sub
I believe I have all the references required...any ideas?