Import from MS Access
Export Data from Access to Excel Ratings: http://www.consultdmw.com/export-access-data-to-excel.html ReDim Limitations: 1. ReDim only for Dynamic Array, not Static Arrays Example: Dim MyArray() as integer ‘ Ok ReDim MyArray(3) Dim MyArray(2) As Integer ‘Declare as Static Array ReDim MyArray(3) ‘This will cause an error Collection with SET NEW
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | Sub dmwExport(query$, path$) On Error GoTo errHandler Dim xlApp As Object Dim wkbk As Object Dim msg$ DoCmd.TransferSpreadsheet _ TransferType: = acExport, _ SpreadsheetType: = acSpreadsheetTypeExcel12Xml, _ TableName: = query$, _ Filename: = path$, _ HasFieldNames: = True Set xlApp = CreateObject("Excel.Application") With xlApp .Visible = True Set wkbk = .Workbooks.Open(path$) End With procDone: Set wkbk = Nothing Set xlApp = Nothing Exit Sub errHandler: msg$ = Err.Description MsgBox msg$, vbExclamation, "Unanticipated Error" Resume procDone End Sub |
[…]
Read More