I've been able to find the code I need to import the file, but there are headers that come through from the group sending the excel file that will not import - they have a "." in them and that won't work. I need to find a way to remove the character and bring the excel header in line with the access table I'm importing to.
I'm using the following to import the file:
Sub Example()
'the path to the excel workbook
Dim strExcelPath As String
strExcelPath = "C:\test\test\testing.xls"
'import data from excel
Call DoCmd.TransferSpreadsheet(acImport, _
acSpreadsheetTypeExcel8, "testtable", strExcelPath, _
True, "A1:AA11")
End Sub
and that work fine up until it hits the offending headers. what is a good, quick bit of code to plug in to alter the headers and what, if any references would need to be added?
Kind of new to the whole VBA thing so I'm getting a lot from the web, but some things just aren't clear.
Thanks,
Chris