Hi,
I have a problem that I need to delete the table records before I paste data into it. The problem is once I delete all the records, Excel VBA (BUG?) will not recognize it as a ListObject. Does anyone know a workaround?
This code:
Sheet111.ListObjects("Target_Table_name").DataBodyRange.PasteSpecial xlPasteValues
will give this error:
Run-time error '91':
Object variable or with block variable not set
It works fine if the table contains records.
Any suggestions?
I have a problem that I need to delete the table records before I paste data into it. The problem is once I delete all the records, Excel VBA (BUG?) will not recognize it as a ListObject. Does anyone know a workaround?
This code:
Sheet111.ListObjects("Target_Table_name").DataBodyRange.PasteSpecial xlPasteValues
will give this error:
Run-time error '91':
Object variable or with block variable not set
It works fine if the table contains records.
Any suggestions?