|
-
May 1st, 2008, 03:09 PM
#1
Clear the contents of all cells in an Excel File???
I have a button on my program. When clicked, I want it to open a pre-determined file and clear the content of every cell in that file. I know how to access excel files and pick a designated one and all that.
Anyone know any code for clearing the contents of all cells?
Thanks.
-
May 1st, 2008, 03:55 PM
#2
Re: Clear the contents of all cells in an Excel File???
Excel.Range.ClearContents();
The difficulty is that you have no idea how difficult it is.
.Net 3.5/VS 2008
-
May 1st, 2008, 04:20 PM
#3
Re: Clear the contents of all cells in an Excel File???
What do I put for the range?
I'm used to putting (1, 1) to reference cell A1. How do I specify a range that clears everything on the spreadsheet?
Thanks.
-
May 2nd, 2008, 04:20 AM
#4
Re: Clear the contents of all cells in an Excel File???
Greetings fellow irishman 
For a range, enter 'A1:IV65536' you can't have anything outside that. Although there is probably some handy function to get a range of everything.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
0100 1101 0110 1001 0110 0011 0110 1000 0110 0001 0110 0101 0110 1100 0010 0000 0100 0101 0110 1100 0110 1100 0110 0101 0111 0010
-
May 2nd, 2008, 12:35 PM
#5
Re: Clear the contents of all cells in an Excel File???
oops! Here is the correct version!!!
xl.displayalerts=false
xls.cells.select
xls.delete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|