Jump to content
Sign in to follow this  
Pat Stanford

Sote WS Name in Cell

Recommended Posts

This script was generated from a request in another forum. As written is stores the Name of the worksheet resource (as shown in the resource browser) into cell B1 of ever worksheet that has an image in the file.

Procedure WorksheetNameToCell;

{Inserts the current name of the worksheet resource in a cell}
{for each worksheet visible in the drawing.}
{The CRow and CCol constants define what cell the naem is stored in.}
{The Criteria in the ForEachObject call can be modified to limit}
{the worksheets affected. Otherwise every visible worksheet will be touched.}


{July 24,2015}
{© 20015, Pat Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}
{No warranty expressed or implied. Use at your own risk}

Const	CRow=1; {Row to store name}
	CCol=2; {Column to store name. Column B=2}

Procedure SetCell(H1:Handle);
Var	H2:Handle;
S1:String;

Begin
	H2:=GetWSFromImage(H1);
	If H2<>Nil then
		Begin
			S1:=GetName(H2);
			SetWSCellFormula(H2,CRow,CCol,CROW,CCOL,S1);
			RecalculateWS(H2);
			ResetObject(H2);
			ResetObject(H1);
		End;
End;

Begin
ForEachObject(SetCell,((T=WORKSHEET)));
End;

Run(WorksheetNameToCell);

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

 

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.

×