Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Darkforce_the_ilogic_guy
1054 Views, 4 Replies

delete all cell in a collumn in an excel with ilogic

is that a to dele all not emtry cell under collum A and B  start form cell A3 And B3  with ilogic?

 

I am using it as a log fil... but want to cleal the file if I start my ilogic on a new file

Tags (2)

i have none code to test with but probaly you could do something like:

xlSheet.Range("A3:A9999").Delete

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Using iLogic, I'm not seeing any easy way to actually 'delete' a cell in an Excel file. Nor be able to set which option to use for either shifting the other cells, Entire Row, or Entire Column, after you delete it, as you have within Excel.

I see a method to 'Clear' its value, though, if that's all you need.

You would most likely have to do this using Inventors API and VBA code with the VBA Editor, once you've included the right "References" for working with Microsoft Excel.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

J-Camper
in reply to: JelteDeJong

replied to wrong post

I think this code should work:

Dim FilePath As String = "C:\Projects\testing.xlsx"
Dim SheetName As String = "This_Sheet"
Dim Column As String = "B"
Dim Row As Integer = 3

GoExcel.Open(FilePath, SheetName)

While Row < 99
GoExcel.CellValue(Column & Row) = "" 'Value
Row = Row+1
End While

GoExcel.Save

GoExcel.Close

Should be easy enough for you to change the string values to look for the correct workbook.