Clear worksheet


#1

How do I clear a worksheet before copying new data?


#2

I think write range should take care of it.no need of clearing.


#3

I am using write range, and starting Cell as A2. However the earlier data is not getting cleared.
The macro I run with old data gives validation error.


#4

@KingTut2010 Please find attached solution. It can be accomplished by workbookapplication but you need to set the sheet.

emptyDT.xaml (7.6 KB)


#5

COuld you provide an example? EMpty datatable is throwing an exception.


#6

Attached


#7

Can I just instantiate an empty datatable and assign that to the write range activity ?


#8

Tried that doesn’t seem to work. If you don’t want to go with the solution I provided, another idea is to implement Hot Keys.


#9

Can you share a sample with hotkeys? you mentioned that the write range should have cleared the range before writing however that is not happenning. ANy idea why ?


#10

emptyDT.xaml (12.0 KB)


#11

Thanks vvaidya, this is great!


#12

You need to provide the selector for the excel document, for the first hot key activity at least. Else it won’t work. At least it didn’t work for me.


#13

You can use Select Range.

image

or