Jump to content

Filling the cells of a Table fast


aloy

Recommended Posts

Hi everyone,

I have a list with sub lists each containing 18 elements. When the sublists are many say 25, the formation of table take about 20 seconds with the following code:

(setq row 2)
(setq cell 0)
(if lst
 (while lst
   (setq lstx(car lst))
   (while (<= cell 17)
     (vla-settext myTable row cell (car lstx))
     (vla-setCellAlignment myTable row cell acMiddleCenter)
     (setq lstx(cdr lstx))
     (setq cell (+ 1 cell))
   )
     (setq lst(cdr lst))
     (setq row(1+ row))
     (setq cell 0)
  )
)

Row 0 is the title and 1 contains the headings of columns.

Can this be speeded up by lambda functions and if so how?.

Thanking in advance.

Aloy

Link to comment
Share on other sites

It may be this that is slowing it down (vla-setCellAlignment myTable row cell acMiddleCenter) setting column to acmiddlecenter not something I have had to do. I did 88 rows and is splat done.

Link to comment
Share on other sites

Yes, that is true. It works as fast as with 'regeneratetablesuppressed' option when the formatting is suppressed. There is no worry about the formatting as I am going to export it to Excel where I can do all that.

 

Thanks BIGAL.

 

Aloy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...