Jump to content

SetWSCellFormulaN - really necessary creating a new worksheet?

Recommended Posts

Posted (edited)

Is it really necessary, to create a new worksheet, everytime I run the script again?


a) or can I "assign the worksheet to the handle in another way, too? (still looking for the way)


b) is there any way, to check, wether a worksheet of a specific name already exists in the file?


worksheet := CreateWS('Wohnungstypen-Auto', 5, 2);


SetWSCellFormulaN(worksheet, zeile, 1, zeile, 1, inString);

Edited by matteoluigi

Share this post

Link to post

Hi @matteoluigi ,

   You can get the handle to any named object using GetObject() like this:


    H := GetObject('Wohnungstypen-Auto');
    if (H <> nil) & (GetTypeN(H) = 18) then begin    { type 18 = Worksheet }

       { do worksheet stuff here }
    end;        { if }


   It is always wise to check a handle's validity and type before using it.






  • Like 2

Share this post

Link to post

Worksheets are just like any other VW object and can be accessed a number of different ways.


As Raymond says, Naming the worksheet might be the easiest way.


But you could also use criteria to get a handle to the Worksheet Image on the drawing and then use that to get the handle to the actual worksheet so you can edit it.

  • Like 1

Share this post

Link to post

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.

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.


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

  • Create New...