How to Get Field / Column Width

M

MarkP

I am trying to build a dynamic export task sheet to excel macro.

I would like to use the column width specified in the current task view (we
have multiple custom task views) as the column width in excel.

How do I determine the current width of a Field / Column ?

Thanks, MarkP
 
R

Rod Gill

The following code lists all field names and widths for a table in the
immediate window:

Sub test()
Dim tfs As TableFields
Dim tf As TableField
Set tfs = ActiveProject.TaskTables("Entry").TableFields
For Each tf In tfs
Debug.Print FieldConstantToFieldName(tf.Field), tf.Width
Next tf
End Sub


--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




MarkP said:
I am trying to build a dynamic export task sheet to excel macro.

I would like to use the column width specified in the current task view
(we
have multiple custom task views) as the column width in excel.

How do I determine the current width of a Field / Column ?

Thanks, MarkP

__________ Information from ESET Smart Security, version of virus
signature database 4891 (20100223) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4891 (20100223) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top