View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Alternative to writing to a closed spreadsheet

"GS" wrote:

I'm pretty sure I gave you this link before, but it demos
read/write with closed workbooks!


Ah, I forgot about that ZIP file.

I found an example in the "ADO Sample Code.xls" file that shows how
to use the "INSERT INTO" command. This command appends
a new row to the end of a spreadsheet.

Do you know if there is an ADO function that allows me to
modify an arbitrary cell of my own choosing? For example, what if
I want to change the contents of cell A1 using ADO??


You treat a worksheet same as a database table. Each row is a record
(starting with row2), each col is a datafield (starting with col1). A1
would be the first fieldname (heading) in your data table (worksheet).
Each record *must have a unique ID* for referencing a specific record.
Thus you would read/write individual fields of a specific record (or
records).

Otherwise, if your worksheet isn't properly contructed as a data table
should be then you have to use range names or addresses to read/write
specific values.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion