Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default XLA function called twice

I've written a few routines in an XLA to check the compare the content of
two user-selected worksheets - part of our data verifcation system. The
routine asks user to select an open workbook from a combo-box on a userForm
(list is populated before opening form). User then chooses required sheet
from a listbox on same form. This works fine when test in VBA editor by
entering function in Debug [e.g. ?GetSheetName() ]. The function is in a
class module in the XLA and is Public.

I've now assigned the function to a button on a new menu and the correct
form is displayed so the user can select sheet as required. Problem is, it
then appears for a second time and asks the user again - as if the function
is being called twice.

I've check with a very basic function (as below) and still get the 'double'
call.
===
Public Function Isvalid() As Boolean

Static intRun As Integer

intRun = intRun + 1
MsgBox "isvalid", vbOKOnly, intRun

End Function
===
This shows two succesive mesage boxes with caption of 1 then 2. New button
in Excel has call to function =IsValid()

(Win 98 + Office97)

Any ideas what's causing this ?



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
How do I know which cell a function is called from? Murami Excel Worksheet Functions 3 November 24th 06 02:22 PM
What is this function called?? jPaulB Excel Discussion (Misc queries) 3 August 4th 06 08:33 PM
Function, dont know what its called Michael Excel Worksheet Functions 1 May 8th 06 09:47 PM
Possible to know who has called a function ? Isabelle Robin Excel Programming 3 March 5th 04 12:33 AM
How do I find which cell called a function? TL[_2_] Excel Programming 3 July 12th 03 02:12 AM


All times are GMT +1. The time now is 11:08 AM.

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"