Paste some records in Access
I have an Excel file with some data. I don't have time to insert them in an Access DB using the customized input form. I just want to copy the data from Excel and paste into the .mdb file (records or columns). Is there any quick mode? I've tried the usual copy&paste but it doesn't always work.
Re: Paste some records in Access
drimades:
According to the Excel Help File, this is what you need to do:
Make sure the Microsoft Excel data is in list (list: A series of rows that contains related data or a series of rows that you designate to function as a datasheet by using the Create List command.) format: each column has a label in the first row and contains similar facts, and there are no blank rows or columns within the list.
Close the Excel workbook that contains the data you want to use in Microsoft Access.
In Access, open the database where you want to copy the Excel data.
On the Access File menu, point to Get External Data, and then click Import.
In the Import dialog box, click Microsoft Excel in the Files of type box.
In the Look in list, locate the file you want to import, and then double-click the file.
Follow the directions in the Import Spreadsheet Wizard.
For more information about this wizard and Access, click Display Help after the wizard is finished.
Good Luck
Re: Paste some records in Access
Re: Paste some records in Access
Not exactly an argument for VB.Net 2003 there, is it?
Re: Paste some records in Access
Well not actually if you consider my code example was an entire application.
So it is actually one line...
VB Code:
moApp.DoCmd.TransferSpreadsheet(Access.AcDataTransferType.acImport, Access.AcSpreadSheetType.acSpreadsheetTypeExcel9, "Excel_Sheet2", "D:\Book1.xls", False, "Sheet2$")