Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > microsoft.public.excel.programming > #108916

Re: Modify Code to loop back through table after its been updated and process it

From TimLeonard <TimLeonard.119e8e98@excelbanter.com>
Newsgroups microsoft.public.excel.programming
Subject Re: Modify Code to loop back through table after its been updated and process it
Date 2016-06-09 03:45 +0100
Message-ID <TimLeonard.119e8e98@excelbanter.com> (permalink)
Organization ExcelBanter.com
References (4 earlier) <TimLeonard.119bc168@excelbanter.com> <nj6tgt$ttv$1@dont-email.me> <TimLeonard.119d5938@excelbanter.com> <nj9lj2$vet$1@dont-email.me> <nj9m69$1vs$1@dont-email.me>

Show all headers | View raw


> I defined the array as follows...
> 
> Dim saAttribs$(14) '//replaces individual vars; uses acAttribs enum
> 
Thanks so much for working with me.  I really appreciate it more than
you know...

I did finally write something to send the updated values back to ACAD
using following code.  I hope it is built correctly, this is a major
accomplishment for me... Pointers are appreciated...


Code:
--------------------
    
  Dim attributeObj As AcadAttribute
  Dim BlockObj As AcadBlock
  Dim Cnt As Long
  
  Dim vAttrData
  vAttrData = xlSheet.UsedRange 'Copy Data as an Array from spreadsheet
  
  'Selection Set codeE
  Cnt = 2
  For Each elem In ThisDrawing.ModelSpace
  With elem
  
  If StrComp(.EntityName, "AcDbBlockReference", 1) = 0 Then
  If elem.HasAttributes Then
  
  handle = elem.handle
  newAttribs = elem.GetAttributes
  
  '         For i = LBound(newAttribs) To UBound(newAttribs)
  For i = 0 To UBound(newAttribs)  ' For Count = LBound(newAttribs) To UBound(newAttribs) 'Read attributes from block
  Dim Attr As AcadAttributeReference
  Set Attr = newAttribs(i)
  'Filter the Tagstring that contain "Addresses" 
  If Attr.TagString = "ADDRESS" Then
  If handle = vAttrData(Cnt, 1) Then
  
  newAttribs(0).TextString = vAttrData(Cnt, 2)
  newAttribs(1).TextString = vAttrData(Cnt, 3)
  newAttribs(2).TextString = vAttrData(Cnt, 4)
  newAttribs(3).TextString = vAttrData(Cnt, 5)
  newAttribs(4).TextString = vAttrData(Cnt, 6)
  newAttribs(5).TextString = vAttrData(Cnt, 7)
  newAttribs(6).TextString = vAttrData(Cnt, 8)
  newAttribs(7).TextString = vAttrData(Cnt, 9)
  newAttribs(8).TextString = vAttrData(Cnt, 10)
  newAttribs(9).TextString = vAttrData(Cnt, 11)
  newAttribs(10).TextString = vAttrData(Cnt, 12)
  newAttribs(11).TextString = vAttrData(Cnt, 13)
  
  newAttribs(0).Update
  newAttribs(1).Update
  newAttribs(2).Update
  newAttribs(3).Update
  newAttribs(4).Update
  newAttribs(5).Update
  newAttribs(6).Update
  newAttribs(7).Update
  newAttribs(8).Update
  newAttribs(9).Update
  newAttribs(10).Update
  newAttribs(11).Update
  
  End If
  Cnt = Cnt + 1
  Exit For
  End If 'Address
  Next i
  
  End If
  End If
  End With 'elem
  Next elem
  [/code




-- 
TimLeonard

Back to microsoft.public.excel.programming | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Modify Code to loop back through table after its been updated and process it TimLeonard <TimLeonard.119a37a8@excelbanter.com> - 2016-06-05 20:21 +0100
  Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-05 20:06 -0400
    Re: Modify Code to loop back through table after its been updated and process it TimLeonard <TimLeonard.119b6d08@excelbanter.com> - 2016-06-06 18:27 +0100
      Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-06 14:42 -0400
        Re: Modify Code to loop back through table after its been updated and process it TimLeonard <TimLeonard.119bc168@excelbanter.com> - 2016-06-06 23:54 +0100
          Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-06 23:41 -0400
          Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-07 12:42 -0400
            Re: Modify Code to loop back through table after its been updated and process it TimLeonard <TimLeonard.119d5938@excelbanter.com> - 2016-06-08 05:34 +0100
              Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-08 03:46 -0400
              Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-08 13:45 -0400
                Re: Modify Code to loop back through table after its been updated and process it GS <gs@v.invalid> - 2016-06-08 13:55 -0400
                Re: Modify Code to loop back through table after its been updated and process it TimLeonard <TimLeonard.119e8e98@excelbanter.com> - 2016-06-09 03:45 +0100

csiph-web