I am trying to pass 2 arguments to a subroutine by assigning it to a .onaction command. The code works when I only pass one string argument but falls down ( I get the "The macros is not available in this workbook or all macros are disabled" error) when I try and add a second integer argument.
The code that works is:-
.OnAction = "'PopulateFields(""" & myArray(x) & """)'"
The subroutine in this instance is declared as:-
PopulateFields(strAppType As String)
The failing code looks like this:-
.OnAction = "'PopulateFields(""" & myArray(x) & """, " & 3 & ")'"
PopulateFields(strAppType As String, intTier As Integer)
I have checked the value of the text passed to the .onaction command in the immediate window and it looks like this:-
'PopulateFields("Screed And Overscreed", 3)'
In the instance that works it looks like this
'PopulateFields("Screed And Overscreed")'
Can anyone see a problem??
The code that works is:-
.OnAction = "'PopulateFields(""" & myArray(x) & """)'"
The subroutine in this instance is declared as:-
PopulateFields(strAppType As String)
The failing code looks like this:-
.OnAction = "'PopulateFields(""" & myArray(x) & """, " & 3 & ")'"
PopulateFields(strAppType As String, intTier As Integer)
I have checked the value of the text passed to the .onaction command in the immediate window and it looks like this:-
'PopulateFields("Screed And Overscreed", 3)'
In the instance that works it looks like this
'PopulateFields("Screed And Overscreed")'
Can anyone see a problem??