Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default ByRef argument type mismatch when passing dictionary object

Hello all,

In one function I am doing the following:

Dim dictMenuOptions As Dictionary
Set dictMenuOptions = New Dictionary
dictMenuOptions.Add "EDIT", "BtnEdit_Click"
dictMenuOptions.Add "COPY", "BtnCopy_Click"
dictMenuOptions.Add "DELETE", "BtnDelete_Click"
dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"

Call RightClick_BlotterMenu(dictMenuOptions)

The first line of "RightClick_BlotterMenu" is defined as :

Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)

Does anyone know why I am getting a "ByRef argument type mismatch" ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default ByRef argument type mismatch when passing dictionary object

Works fine for me.

I presume you have set a reference, and this is all in a standard code
module?

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"signon77" wrote in message
...
Hello all,

In one function I am doing the following:

Dim dictMenuOptions As Dictionary
Set dictMenuOptions = New Dictionary
dictMenuOptions.Add "EDIT", "BtnEdit_Click"
dictMenuOptions.Add "COPY", "BtnCopy_Click"
dictMenuOptions.Add "DELETE", "BtnDelete_Click"
dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"

Call RightClick_BlotterMenu(dictMenuOptions)

The first line of "RightClick_BlotterMenu" is defined as :

Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)

Does anyone know why I am getting a "ByRef argument type mismatch" ?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default ByRef argument type mismatch when passing dictionary object

ByRef is the default, you need ByVal

Sub RightClick_BlotterMenu(ByVal MenuOptionsDictionary As
Dictionary)


"signon77" wrote:

Hello all,

In one function I am doing the following:

Dim dictMenuOptions As Dictionary
Set dictMenuOptions = New Dictionary
dictMenuOptions.Add "EDIT", "BtnEdit_Click"
dictMenuOptions.Add "COPY", "BtnCopy_Click"
dictMenuOptions.Add "DELETE", "BtnDelete_Click"
dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"

Call RightClick_BlotterMenu(dictMenuOptions)

The first line of "RightClick_BlotterMenu" is defined as :

Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)

Does anyone know why I am getting a "ByRef argument type mismatch" ?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default ByRef argument type mismatch when passing dictionary object

On Jan 8, 1:45*pm, "Bob Phillips" wrote:
Works fine for me.

I presume you have set a reference, and this is all in a standard code
module?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"signon77" wrote in message

...



Hello all,


In one function I am doing the following:


* * * * * * * * * * Dim dictMenuOptions As Dictionary
* * * * * * * * * *Set dictMenuOptions = New Dictionary
* * * * * * * * * *dictMenuOptions.Add "EDIT", "BtnEdit_Click"
* * * * * * * * * *dictMenuOptions.Add "COPY", "BtnCopy_Click"
* * * * * * * * * *dictMenuOptions.Add "DELETE", "BtnDelete_Click"
* * * * * * * * * *dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
* * * * * * * * * *dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"


* * * * * * * * * *Call RightClick_BlotterMenu(dictMenuOptions)


The first line of "RightClick_BlotterMenu" is defined as :


* * * * * * * * *Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)


Does anyone know why I am getting a "ByRef argument type mismatch" ?- Hide quoted text -


- Show quoted text -



Hi Bob

When you say "set a reference" what does that mean?

Rob


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default ByRef argument type mismatch when passing dictionary object

In the VBIDE, ToolsReferences, and scroll down to Microsoft Scripting
Runtime, and check that box.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"signon77" wrote in message
...
On Jan 8, 1:45 pm, "Bob Phillips" wrote:
Works fine for me.

I presume you have set a reference, and this is all in a standard code
module?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"signon77" wrote in message

...



Hello all,


In one function I am doing the following:


Dim dictMenuOptions As Dictionary
Set dictMenuOptions = New Dictionary
dictMenuOptions.Add "EDIT", "BtnEdit_Click"
dictMenuOptions.Add "COPY", "BtnCopy_Click"
dictMenuOptions.Add "DELETE", "BtnDelete_Click"
dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"


Call RightClick_BlotterMenu(dictMenuOptions)


The first line of "RightClick_BlotterMenu" is defined as :


Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)


Does anyone know why I am getting a "ByRef argument type mismatch" ?-
Hide quoted text -


- Show quoted text -



Hi Bob

When you say "set a reference" what does that mean?

Rob





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default ByRef argument type mismatch when passing dictionary object

On 8 Jan, 14:07, "Bob Phillips" wrote:
In the VBIDE, ToolsReferences, and scroll down to Microsoft Scripting
Runtime, and check that box.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"signon77" wrote in message

...
On Jan 8, 1:45 pm, "Bob Phillips" wrote:





Works fine for me.


I presume you have set a reference, and this is all in a standard code
module?


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


"signon77" wrote in message


...


Hello all,


In one function I am doing the following:


Dim dictMenuOptions As Dictionary
Set dictMenuOptions = New Dictionary
dictMenuOptions.Add "EDIT", "BtnEdit_Click"
dictMenuOptions.Add "COPY", "BtnCopy_Click"
dictMenuOptions.Add "DELETE", "BtnDelete_Click"
dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"


Call RightClick_BlotterMenu(dictMenuOptions)


The first line of "RightClick_BlotterMenu" is defined as :


Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)


Does anyone know why I am getting a "ByRef argument type mismatch" ?-
Hide quoted text -


- Show quoted text -


Hi Bob

When *you say "set a reference" what does that mean?

Rob- Hide quoted text -

- Show quoted text -


Hi Bob,

Microsoft Scripting Runtime was already referred to by the
application.

On the face of it this code should work. I've even rebooted my machine
but still have precisely the same error.

Strangely it even occurs when I change the object from a dictionary
object to a collection.

Rob
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default ByRef argument type mismatch when passing dictionary object

On 8 Jan, 14:07, "Bob Phillips" wrote:
In the VBIDE, ToolsReferences, and scroll down to Microsoft Scripting
Runtime, and check that box.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"signon77" wrote in message

...
On Jan 8, 1:45 pm, "Bob Phillips" wrote:





Works fine for me.


I presume you have set a reference, and this is all in a standard code
module?


--
---
HTH


Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)


"signon77" wrote in message


...


Hello all,


In one function I am doing the following:


Dim dictMenuOptions As Dictionary
Set dictMenuOptions = New Dictionary
dictMenuOptions.Add "EDIT", "BtnEdit_Click"
dictMenuOptions.Add "COPY", "BtnCopy_Click"
dictMenuOptions.Add "DELETE", "BtnDelete_Click"
dictMenuOptions.Add "PKG EDIT",
"BtnPackageEditor_Click"
dictMenuOptions.Add "OFFICIAL",
"BtnOfficial_Click"


Call RightClick_BlotterMenu(dictMenuOptions)


The first line of "RightClick_BlotterMenu" is defined as :


Sub RightClick_BlotterMenu(MenuOptionsDictionary As
Dictionary)


Does anyone know why I am getting a "ByRef argument type mismatch" ?-
Hide quoted text -


- Show quoted text -


Hi Bob

When *you say "set a reference" what does that mean?

Rob- Hide quoted text -

- Show quoted text -


Hi Bob,

I've found the source of the issue. I was looking in the wrong area
entirely.

Thanks for your help.

Rob
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default ByRef argument type mismatch when passing dictionary object

signon77 wrote:

I've found the source of the issue. I was looking in the wrong area
entirely.

Thanks for your help.

Rob


Care to enlighten the rest of us as to the source of the issue?

Thanks,
Alan Beban
Reply
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
type mismatch error when passing collection byRef Tara H Excel Programming 2 September 14th 07 05:56 PM
HELP "ByRef Argument Type Mismatch" RocketMan[_2_] Excel Programming 6 June 7th 07 07:00 PM
passing range to function: type of argument is byref incompatible mcgurkle Excel Programming 3 May 7th 07 08:43 AM
"ByRef argument type mismatch" Error Baapi[_4_] Excel Programming 2 September 17th 05 12:47 AM
ByRef argument type mismatch error? sermest Excel Programming 4 June 17th 05 06:50 PM


All times are GMT +1. The time now is 09:12 PM.

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

About Us

"It's about Microsoft Excel"