Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to edit the cells of general table but I can't seem to get it right. I'm pretty new with VBA, could someone give me a sample code for doing this, I can't seem to find anything for a general table. VBA or iLogic is fine.
This is what I have now but I keep getting the error :
"Object reference not set to an instance of an object."
Dim oDoc As DrawingDocument
oDoc = ThisDoc.Document
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oRow() As String
oRow(1) = "A"
oRow(2) = "INITIAL RELEASE"
oRow(3) = Date.Now
oRow(4) = "MF"
'Asuming a revision table is on the sheet
Dim oRevTable As CustomTable
oRevTable = oSheet.CustomTables.Item(1)
'Change the value of the first cell of row 1
oRevTable.Rows(1).Item(1).Text = oRow(1)
'Change the value of the second cell of row 1
oRevTable.Rows(1).Item(2).Text = oRow(2)
'Change the value of the third cell of row 1
oRevTable.Rows(1).Item(3).Text = oRow(3)
'Change the value of the fourth cell of row 1
oRevTable.Rows(1).Item(4).Text = oRow(4)
Thanks!
Solved! Go to Solution.