vba - export data from access to excel 2007 -
i new vba coding , facing problem.
i need transfer table access db excel
but whenever try run code gives error says table not present in db
my code:
sub hello() call transfertoexcel end sub public function transfertoexcel() on error goto errorhandler dim strtable string dim worksheetpath string worksheetpath = "c:\users\desktop\test.xlsx" strtable = "testtable" docmd.transferspreadsheet transfertype:=acexport, _ spreadsheettype:=acspreadsheettypeexcel12, _ tablename:=strtable, filename:=worksheetpath, _ hasfieldnames:=true errorhandlerexit: exit function errorhandler: msgbox "error no:" & err.number _ & "; description: " & err.description resume errorhandlerexit end function
Comments
Post a Comment