September 15, 2004 at 9:03 am
I tried to use the following syntax
RS.Field.Delete("Name of Field")
and
RS.Field.Delete 1
without success.
Both give med following error in Excel2003 where I want to first use this field then delete it and use copyfromrecordset but without this field
"Operation is not allowed in this context"
what is wrong and how can I delete a field after using it?
September 15, 2004 at 9:28 pm
Try
or
Seems you're just missing the "s" in Fields
HTH
AAM
September 16, 2004 at 5:49 am
Why do you want to do it?
If you don't need the field, it's more efficient not to get it in the first place (network traffic). If you did need it but now don't, is the overhead of getting rid of it worthwhile?
September 16, 2004 at 7:34 am
Hi,
The error you are getting is due to the fact that you are trying to delete the field from an open recordset which is something that you cannot do, hence the runtime error, your best course of action is to remove the unwanted column in the excel spreadsheet after doing the copyfromrecordset
September 19, 2004 at 7:31 am
I need the column first to set defined names, then I want to to set values in the sheet and in the same column as well where I placed my defined name. So I was thinking to set the defined names by looping through that first column in my RS, then delete that column and use CopyFromRecordset to place the rest values by WKSHEET.Range("A1").CopyFromRecordset RS so I place values in the first column as well. Seems to be a lot of trouble with ADO recordsets
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply