problem access 2013 to 2010

benjamin.grimm

Registered User.
Local time
Today, 13:51
Joined
Sep 3, 2013
Messages
125
hello guys
i use this code in access 2013

Code:
Dim xlApp As Object ' Excel.Application
Dim xlBook As Object ' Excel.Workbook
Dim xlSheet As Object ' Excel.Worksheet
Dim rst As DAO.Recordset
'Excel-Objekt öbffnen und Workbook hinzufügen
Set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
Set xlBook = xlApp.Workbooks.Open("E:\Michi\Export.xlsx")
'In Tabellenblatt Gesamt schreiben
Set xlSheet = xlBook.Worksheets(1)
Set rst = CurrentDb.OpenRecordset("Vorratseinplannung_MB_Gesamt")
xlSheet.Cells(7, 13 + Month(Date)).CopyFromRecordset.rst
rst.Close

I use it now also in access 2010 and it doesnt work.

The problem is the following row

xlSheet.Cells(7, 13 + Month(Date)).CopyFromRecordset.rst
rst.Close

It shows up a runtime error 450 : wrong number of argument or wrong allocation to an attribute.

greetz benjamin
 
It is CopyFromRecordset rst not CopyFromRecordset.rst
 

Users who are viewing this thread

Back
Top Bottom