Hello.
I use the following module to import data from a spreadsheet.
Function ImportAutoCount()
MySheetPath = "R:\DEPT-BR\CONSUMER LENDING\CONSUMER LENDING DATABASES\CRYSTAL AND LOANSPQ REPORTS\AUTO COUNT.xls"
CreateObject ("Excel.Application")
Set XlBook = GetObject(MySheetPath)
DoCmd.TransferSpreadsheet acImport, 8, _
"tbl_MeridianLinkFile", "R:\DEPT-BR\CONSUMER LENDING\Consumer Lending Databases\Crystal and LoansPQ Reports\AUTO COUNT.xls", True, "Sheet1!A3:BV25000"
End Function
It works great. However, occassinally it will drop data and I have to go in and manually trim spaces in one particular column in order for the data to be imported.
Is there code that I could add to my VBA to automatically trim the column or range prior to importing the data? Thanks.
I use the following module to import data from a spreadsheet.
Function ImportAutoCount()
MySheetPath = "R:\DEPT-BR\CONSUMER LENDING\CONSUMER LENDING DATABASES\CRYSTAL AND LOANSPQ REPORTS\AUTO COUNT.xls"
CreateObject ("Excel.Application")
Set XlBook = GetObject(MySheetPath)
DoCmd.TransferSpreadsheet acImport, 8, _
"tbl_MeridianLinkFile", "R:\DEPT-BR\CONSUMER LENDING\Consumer Lending Databases\Crystal and LoansPQ Reports\AUTO COUNT.xls", True, "Sheet1!A3:BV25000"
End Function
It works great. However, occassinally it will drop data and I have to go in and manually trim spaces in one particular column in order for the data to be imported.
Is there code that I could add to my VBA to automatically trim the column or range prior to importing the data? Thanks.