Results 1 to 1 of 1

Thread: Using Classes

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2009
    Posts
    83

    Using Classes

    Dear All. I've been using VBA (which is my first encounter with programming of any kind) for 9 months or so. So I'm fairly new to all this.

    I'm currently putting together a spreadsheet-based application that makes extensive use of balloons. I never want multiple balloons to be open. So I've declared the balloon as a public object. I've then used various different routines to pop-up various different kinds of balloons. They're all of the basic form:

    Code:
    Public opBal as balloon
    Sub PopUp(nIndex as long, in order to specify the text that should appear in the balloon)
       Set opBal = nothing
       Set opBal = New Balloon
       Assistant.On = True
       Assistant.Visible = True
       Assistant....
       '...etc, etc...
       '(it seems necessary to specify these assistant settings each
       'time I popup a balloon since, for some reason, my settings don't
       'get remembered: perhaps the network I'm on automatically
       'disables them or something, I don't know...
       with opBal
          .Heading(1) = ...text based on nIndex
          .Text(1) = etc, etc
          '...etc,
          .close
          '....
       end with   
    end sub
    From what little I can understand of such things, it seems to me that using classes should be able to make all this a bit neater and mean I don't need to repeat all the same set-up and close instructions at the tops and tails of my routines. Could someone give me some pointers please?
    Last edited by James_B; Jul 19th, 2009 at 04:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width