Hi,
I use below code, to convert excel to recordset and save it as XML file:
This is unfinished code, so there some unnecessary variables, so just ignore them.
The issue which I encounter is that several column names have character ".", for instance, "Name.", "Employee No.", etc. Due to some reason, SQL code "SELECT * FROM [Duomenys$a:ai]" converts dots in column names to hash symbol, and then recordset contains field names "Name#", "Employee No#".
I tried many different approaches: tried to use different connection string, tried to use specific SQL code "SELECT [Name.] FROM [Duomenys$a:ai]", but nothing worked. Specific SQL code works only when I use hash symbol.
For instance, this works:
This doesn't work:
Trying to change field name in the recordset isn't possible. If I read material for working with recordsets correctly, then it's not possible to change field names after recordset is opened, but I don't know how to change field names before this action.
I'm very little familiar with working with ADO recordsets via Excel VBA, this is new for me. SO I would appreciate the help to find a solution, how to avoid Excel converting dot character "." to hash character "#" in the columns/fields names.
Bookmarks