ABXZone Computer  Forums



Reply
 
Thread Tools Display Modes
Old 12-03-2008, 04:43 PM   #1
Gorganzola
Moderator
 
Gorganzola's Avatar
 
Join Date: May 2001
Posts: 9,514
VBA Passing an Object

One the UserForm1 is defined a frame called frameItemDetails.

If I do MsgBox(typename(frameItemDetails)), it returns Frame. Anyone have a clue why it is saying Type Mismatch as the error?

The following code gives me a type mismatch error on the call to the procedure:

Code:
' Purpose: Creates a scrollbar and adds it to a specified frame.
Private Sub Add_ScrollBar_to_Frame(ByRef aFrame As Frame)
    Const HEIGHT As Integer = 2
    Const WIDTH As Integer = 9
    
    ' Name of the frame
    With aFrame
    
        ' Create the vertical scrollbar
        .ScrollBars = fmScrollBarsVertical
        
        ' Change the value of 2 as required
        .ScrollHeight = .InsideHeight * HEIGHT
        .ScrollWidth = .InsideWidth * WIDTH
    End With
End Sub
Code:
Private Sub UserForm_Activate()
    Add_ScrollBar_to_Frame (Me.frameItemDetails)
End Sub
__________________
TTFN.

I wasn't asleep at the switch, I was drunk. -- Homer J. Simpson

Q. How many dull people does it take to change a lightbulb?

A. One.

A very useful tool on these forums:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


You can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
in public.

(Offline)   Reply With Quote

Advertisement [Remove Advertisement]
Old 12-03-2008, 05:54 PM   #2
Gorganzola
Moderator
 
Gorganzola's Avatar
 
Join Date: May 2001
Posts: 9,514
Re: VBA Passing an Object

Fixed it.
__________________
TTFN.

I wasn't asleep at the switch, I was drunk. -- Homer J. Simpson

Q. How many dull people does it take to change a lightbulb?

A. One.

A very useful tool on these forums:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


You can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
in public.

(Offline)   Reply With Quote
Old 12-03-2008, 05:57 PM   #3
Ozzie
CRS Designee
 
Ozzie's Avatar
 
Join Date: Feb 2001
Location: Apple Valley, MN
Posts: 10,509
Re: VBA Passing an Object

Whew! Good thing you fixed it 'cause I didn't have a clue what you were talking about...
__________________
Have you supported your forum today?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.



To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Change is the only constant in life


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
(Offline)   Reply With Quote
Old 12-03-2008, 06:41 PM   #4
k0NG0
Remembering TQ
 
k0NG0's Avatar
 
Join Date: Mar 2001
Location: Sweden
Posts: 13,749
Re: VBA Passing an Object

And I thought Visual Basic made your heart shrivel up and die.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Use
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
-
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Feeling multicore elation? Remember this correlation:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
.
(Offline)   Reply With Quote
Old 12-04-2008, 04:53 PM   #5
Gorganzola
Moderator
 
Gorganzola's Avatar
 
Join Date: May 2001
Posts: 9,514
Re: VBA Passing an Object

lol, only on the third tuesday of every other monday in the last week of April during a leap year.

VBA isn't my language of choice but it suits my needs for what I'm doing right now. I'm tempted to crack open a compiler, but not quite yet. First time actually using VBA to be honest.

Quote:
Originally Posted by k0NG0 View Post
And I thought Visual Basic made your heart shrivel up and die.
__________________
TTFN.

I wasn't asleep at the switch, I was drunk. -- Homer J. Simpson

Q. How many dull people does it take to change a lightbulb?

A. One.

A very useful tool on these forums:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


You can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
in public.

(Offline)   Reply With Quote
Old 01-01-2009, 12:28 AM   #6
Wagner
Registered User
 
Join Date: Jan 2009
Posts: 2
Re: VBA Passing an Object

Good
(Offline)   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com

© 2006 - 2016 ABXZone Forums | About ABX Zone Forums | Advertisers | Investors | Legal | A member of the Crowdgather Forum Community