Unfortunately, I am very poor at ADO/SQL, so I do not know that I will be able to help much, other than for the Excel aspects... But of what I can see in your code:
(1) Excel Cells hold numbers as Double Data Types and so it is only 64 bits. This means that it only has precision out to 15 Decimal values. This is why your Data is being Truncated and you are losing the 16th digit.
If the result from your Recordset is actually a String with 16 digits in it, you will want to prepend a Single Quote () character to the beginning of this String. Then pass that result to the xlRng.Value. Something like this:
Code:
Dim xlRng as Excel.Range
xlRng = xlApp.Range("A1")
xlRng.Value = "" & RecordSetResult.ToString
This is the basic idea, I hope this was clear?
(2) The 2nd part I cant figure out at all. It looks like youve left out your SQL String and other factors, so I really dont know what its trying to do. That said, Im a n00b in ADO and so Im not sure how much it would help me.
The bigger issue, though, is that I dont see any Excel Code in there. If using ADO to read the Worksheet, this should be provided within the ConnectionStr. But if you are using a RecordSet to get your values and then post the results to the Worksheet, I dont see where that is happening.
I also dont see any Excel.AutoFilter code in there. If you wish to use Excels AutoFilter, I would try opening up Excel itself and using the Macro Recorder with Alt|Tools|Macros|RecordMacros... and then use the AutoFilter properties you want. When done, Stop the Recorder and hit Alt+F11 to see the resulting code. It will
not be code that will run in .Net, but it will give you a pretty good idea of whats going on. Hit F1 on any of the Properties, Methods or Objects that look of interest in order to get Help on these topics. Also, use the Object Browser, searching on "AutoFilter", then get help on those Objects and Properties. This should start to give you a good feel...
-- Mike