Question Clear content of cells in Excel after export from DGV

Rabi

Member
Joined
Mar 22, 2022
Messages
17
Programming Experience
Beginner
I tried this line to clear all the data in column 'd' of worksheet in excel after export the data from DGV. Is there a professional way instead of this way ?because I limited the cells in columns by 5000
Worksheet.get_range("d1","d5000").Cells.Clear();
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,251
Location
Chesapeake, VA
Programming Experience
10+
C#:
Worksheet.Columns["D"].Delete();
 

Rabi

Member
Joined
Mar 22, 2022
Messages
17
Programming Experience
Beginner
There is no 'Delete' method
 

Attachments

  • 20220328_220744.jpg
    20220328_220744.jpg
    163.1 KB · Views: 4
  • 20220328_220744.jpg
    20220328_220744.jpg
    163.1 KB · Views: 4

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
5,251
Location
Chesapeake, VA
Programming Experience
10+
Darn it. Another property that returns an object instead of the appropriate type. Sorry that doesn't work.
 
Top Bottom