
Originally Posted by
ItsMe
Let me know how it goes. The reference you need is Microsoft Office XX.X Object Library.
The line of code that creates the object is
Application.FileDialog(msoFileDialogFilePicker)
The example in sub procedure cmdPicker_Click should get you going....
The code in my Access file was correct except one small mistake, which was noticed by an online friends in another forum, below is the mistake which i was doing.
- The Export Specification in the TransferDatabase() Method was inconsistent with the Extension for the Filename.
Code:
Sub ExportTable()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "FinalTable", Forms![Form1]![Text17].Value
End Sub
- namely
Code:
acSpreadsheetTypeExcel9 <> *.xlsx
- So had two options:
- Change the Excel Type via acSpreadsheetTypeExcel9 to a higher Version that supports the *.xlsx Extension.
- Change all occurrences of .xlsx in the Code (4) to .xls for maximum portability.
- I used the first one and changed the code to
Code:
Sub ExportTable()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "FinalTable", Forms![Form1]![Text17].Value
End Sub
Here is the link of the forum for my other friends
http://www.utteraccess.com/forum/Sav...-t2017675.html