본문 바로가기
개발자 커뮤니티에 오신 것을 환영합니다!

[vba] Export Excel to Access

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 4,978회 작성일 22-09-19 10:00

본문

Sub program1472()
    Dim acc As Object
    Set acc = CreateObject("Access.Application")
    acc.OpenCurrentDatabase ThisWorkbook.Path & "\DB.accdb"
    acc.DoCmd.TransferSpreadsheet _
            TransferType:=0, _
            SpreadSheetType:=acSpreadsheetTypeExcel12Xml, _
            TableName:="program1472", _
            Filename:=Application.ActiveWorkbook.FullName, _
            HasFieldNames:=True, _
            Range:="tem$A1:B10"
    acc.CloseCurrentDatabase
    acc.Quit
    Set acc = Nothing
End Sub

첨부파일

댓글목록

등록된 댓글이 없습니다.


Copyright © program1472 | IT HUB. All rights reserved.