highlighting excel rows via ado connection?

Waldo2k2

Member
Joined
Feb 6, 2006
Messages
7
Programming Experience
5-10
Hi,
I'm outputting a datatable to excel via ado.net. I've been scouring the web as well as msdn, but cannot find out how (if possible) to save a record as a highlighted row in an excel file. Does anyone have any ideas?
 
Not sure if it will work (and persist) through ADO, but the normal way to do this in VBA scripting is to use the .Select method on a Range collection.
 
hmm...that's something I've thought about, but I'd have to open an instance of excel, create a blank worksheet, and inject vba code on the fly...way too clunky for a release app. If it was just something for around the house I'd do it though.

I suppose I could do the highlighting by other means besides ADO. The problem is there aren't any good explanations of the xls file format anywhere that I've seen. There has to be someway of writing a file in some format, saving it as an .xls, and ending up with some rows highlighted. There has to be some way.
 
Well, I was obviously thinking about something else there.. don't really know much about the ADO approach to Excel, know it is OleDb interfaceto the data, so perhaps only raw data? I don't know.

I found comprehensive documentation about Microsoft Excel file formats (all of them looks like) from OpenOffice, have a look, maybe you find something in the 222 pages, index 6.88 is about selection:
http://sc.openoffice.org/excelfileformat.pdf
 
Yes I believe you are correct on ADO being a raw data only type of situation...which kind of stinks, I wish they would have taken it a step further and allowed us to do data formatting as well. I'll look at the open office spec's. Thanks for your help. If I happen to stumble upon anything neat I'll post it back here for future reference. Thanks again.
 
Back
Top