Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ADD, RENAME AND DELETE COLUMNS using ADO

Hi All,

I would like to ADD, RENAME and DELETE COLUMNS In Excel using ADO.
I am using ADO 2.7, Excel 2002.

I have used the following code for delete column..

conConnection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=""" & strExcelFileName & """;Extended Properties=""Excel
8.0;HDR=Yes"""
conConnection.Mode = adModeReadWrite
conConnection.Open
strSQL = "ALTER TABLE [" & SheetName & "$] DROP COLUMN [" &
strColumnName & "]"
conConnection.Execute strSQL


Similarly I have used SQL for Adding and renaming columns.

But in all cases I am getting the error -2147467259 Invalid Operation.


Please help me to solve this problem.


Regards,
Paramasivan

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot Move, Copy, Insert, Rename, or Delete a Worksheet in Any Wo JG Excel Discussion (Misc queries) 6 February 4th 09 06:42 PM
delete and rename tab options are grayed out dancoup Excel Worksheet Functions 1 October 14th 08 06:50 PM
Macro To Delete/Add & Rename/Arrange Sheets steven.holloway Excel Discussion (Misc queries) 5 June 13th 08 06:40 PM
HOW DO I DELETE A WORKSHEET IN EXCEL? NOT HIDE IT OR RENAME IT deborah.hill Excel Worksheet Functions 6 June 24th 05 04:33 PM
"Delete" should not be next to "rename" on right-click of mouse Beany Excel Discussion (Misc queries) 3 June 20th 05 10:54 PM


All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"