LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default array of labels

I want to modify a UserForm dynamically by adding some number of labels from
my VB/Excel program:
Dim labels() as MSForms.Label
:
ReDim labels(NumLabels)

At this point I have an array of Labels with each value set to Nothing. If
I do this:

Set labels(0) = New MSForms.Label
I get runtime "Invalid use of New keyword" and Help says I cannot reference
a class name in this context -- I need to reference a specific object name,
e.g. Label1. So I tried:

Dim Label1 as MSForms.Label
Set labels(0) = New Label1

and I get "User-defined type not defined"

I have tried other things such as
Dim labels() as New MSForms.Label
and I also get errors.

How do I programmatically create an array of Labels so that I can place them
on my UserForm?


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2007 text labels in category axis - missing labels Boris Charts and Charting in Excel 3 December 5th 08 04:33 PM
How do i create labels so, could only move and type in labels only kloniki Excel Discussion (Misc queries) 1 April 12th 08 06:04 AM
Icons __AND__ labels?! How do I get rid of toolbar LABELS! shamblinthru New Users to Excel 2 March 19th 07 09:19 PM
get all the labels of all forms in array RB Smissaert Excel Programming 3 October 23rd 05 08:13 PM
Excel 2003 and Labels (NOT Address Labels) Los Excel Discussion (Misc queries) 2 May 4th 05 01:57 PM


All times are GMT +1. The time now is 04:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"