Hi everybody
We got an Access procedure that fills an Excel sheet (.xlt) with a recordset from an access table.
The Excel sheet has particular formats for specific cells/columns.
Everything goes well with Excel 97, whereas, using excel 2000, formats are completely lost.
Here's the code we wrote to do the export:
If client PC has got Excel 2000, all cells and columns formats are lost.
Thank in advance for every help, bye.
We got an Access procedure that fills an Excel sheet (.xlt) with a recordset from an access table.
The Excel sheet has particular formats for specific cells/columns.
Everything goes well with Excel 97, whereas, using excel 2000, formats are completely lost.
Here's the code we wrote to do the export:
Code:
'''''''''''''''''''''''''''''''''''''
'create recordset and set excel sheet properties
'''''''''''''''''''''''''''''''''''''''
StrSql = "select * from TABLE"
Set RsXls = CurrentDb.OpenRecordset(StrSql, dbOpenSnapshot)
oApp.Workbooks.Add Template:=XLTMODELNAME
With oApp.ActiveSheet.QueryTables.Add(Connection:=RsXls, Destination:=oApp.Range("A10"))
.FieldNames = False
.RefreshStyle = xlOverwriteCells
.RowNumbers = False
.FillAdjacentFormulas = False
.RefreshOnFileOpen = False
.HasAutoFormat = False
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SavePassword = True
.SaveData = False
End With
RsXls.Close
''''''''''''''''''''''''''''''''''''''''''''''''''
'export
'''''''''''''''''''''''''''''''''''''''''''''''
oApp.ActiveWorkbook.SaveAs FileName:=NomeFileCompleto _
, FileFormat:=xlExcel5, PASSWORD:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=True
Thank in advance for every help, bye.