Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
RowNumber corrupts formatting of Querytable
Hi All !
I have used the Querytable in Excel to display data, I selected from my Database. The date-fields were formatted as date, the numbers as numbers. So good so far. Then I decided to use RowNumbers. After I set RowNumbers=True, the number was displayed as a date and vice versa. I found out, that the formatting (date, number) stayed on the column, where it was before, but the data has moved one column right, because the RowNumber was inserted in the first column. Is this a bug in Excel, or did I miss to set a parameter ? This is my Code: Table = WSData.QueryTables.Add("ODBC;DSN=" & DSN, WSData.Range("A1"), SQLText) XLApp.DisplayAlerts = False Table.Name = "Abfrage von " + DSN Table.AdjustColumnWidth = True Table.BackgroundQuery = True Table.FieldNames = True Table.FillAdjacentFormulas = False Table.PreserveColumnInfo = True Table.PreserveFormatting = True Table.RefreshOnFileOpen = False Table.RefreshPeriod = 0 Table.RefreshStyle = 1 Table.RowNumbers = True Table.SavePassword = False Table.SaveData = True Table.Refresh(True) Where WSData is my Datasheet and XLApp my Application-Object Can anyone of you help me ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
to set rownumber | Excel Discussion (Misc queries) | |||
How to use the rownumber of the current cell in a formula | Excel Worksheet Functions | |||
Cells( rowNumber, colName ) doesn't work | Excel Programming | |||
Reference to DLL corrupts on recompile of dll | Excel Programming | |||
QueryTable Field Name formatting | Excel Programming |