Update Excel Table with ADO and SQL

  • Thread starter Thread starter Todd Huttenstine
  • Start date Start date
T

Todd Huttenstine

Hey guys

This question is related to my other posts. I have
figured out how to update cells in an Excel file but I
still have not quite been able to specify an exact cell to
update.

Lets say I have a range of data in cells A1:Z100. Not all
cells have values in them... some do and some dont. Lets
say cell M10 has the value "hello" in it. I want to
update that value to now say "bye". How would I do that?

Also how would a create a new table in cells AB1:AZ100
called "Employees"?

Also how would I delete this table?


Thank you
todd Huttenstine
 
...
This question is related to my other posts. I have
figured out how to update cells in an Excel file but I
still have not quite been able to specify an exact cell to
update.

Lets say I have a range of data in cells A1:Z100. Not all
cells have values in them... some do and some dont. Lets
say cell M10 has the value "hello" in it. I want to
update that value to now say "bye". How would I do that?

This question is answered in my other posts <g>. However, 'Not all
cells have values in them' suggests Jet may be determining the wrong
data type e.g. if Jet thinks the column is numeric your update using
'bye' will fail, even if you are updating a single cell. What error
message are you getting? For more info on how Jet determines the data
type of the column see:

http://www.dicks-blog.com/excel/2004/06/external_data_m.html
Also how would a create a new table in cells AB1:AZ100
called "Employees"?

AFAIK this is possible to do directly. You could fudge it by creating
a table with dummy column headers in cells A1:AA1, then use an update
query (with HDR=No of course <g>) to set the dummy column headers to
null. For a similar work around, involving rows rather than columns,
see this recent post:

http://groups.google.com/[email protected]

You would delete such a table by dropping the sheet e.g.

DROP TABLE [MySheet$]

Jamie.

--
 
...
This question is related to my other posts. I have
figured out how to update cells in an Excel file but I
still have not quite been able to specify an exact cell to
update.

Lets say I have a range of data in cells A1:Z100. Not all
cells have values in them... some do and some dont. Lets
say cell M10 has the value "hello" in it. I want to
update that value to now say "bye". How would I do that?

This question is answered in my other posts <g>. However, 'Not all
cells have values in them' suggests Jet may be determining the wrong
data type e.g. if Jet thinks the column is numeric your update using
'bye' will fail, even if you are updating a single cell. What error
message are you getting? For more info on how Jet determines the data
type of the column see:

http://www.dicks-blog.com/excel/2004/06/external_data_m.html
Also how would a create a new table in cells AB1:AZ100
called "Employees"?

AFAIK this is possible to do directly. You could fudge it by creating
a table with dummy column headers in cells A1:AA1, then use an update
query (with HDR=No of course <g>) to set the dummy column headers to
null. For a similar work around, involving rows rather than columns,
see this recent post:

http://groups.google.com/[email protected]

You would delete such a table by dropping the sheet e.g.

DROP TABLE [MySheet$]

Jamie.

--
 
Back
Top