2012-11-17 2 views
0

데이터가있는 Excel 파일이 있는데 VBA를 사용하여 MS Access로 모든 데이터를 가져온 다음 쿼리를 실행하고 마지막으로 데이터를 보고서에 표시해야합니다. 어떻게 확인할 수 있습니까? 에서와 같이엑셀에서 MS Access로 데이터 가져 오기

+5

! 어때 [이 게시물에 대한 (http://stackoverflow.com/search?q=how+to+import+excel+data+into+access+vba) – bonCodigo

답변

2

참조 : http://office.microsoft.com/en-in/excel-help/import-excel-data-to-an-access-database-HP005200852.aspx

은 Microsoft Excel 데이터가리스트 형식으로되어 있는지 확인 : 각 열은 첫 번째 행의 레이블이 유사한 사실을 포함하고, 목록에 빈 행이나 열이 없습니다.

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. 

감사가 달성 될 수있다 당연히

0

사용 docmd.transterspreadsheet :

DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml,tblName, impPath, False, impSheet 

where tblName is table to add data to 
     impPath is path and file name of excel workbook to import from 
     false = no field names in import area (true =field name included in import area) 
     sheet = sheet name and range ie "sheet!b5:j15" 
+0

별로 http://msdn.microsoft.com/en-kr/ us/library/office/aa193071 (v = office.10) .aspx – Fionnuala

관련 문제