LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default click event problem in excel 2003 only

Hello All,

I have an information system that uses multiple Excel files with macros.
On many of the sheets, we have a combo box that enables the user to hide and
show certain informations.
Here is an exemple of the code behind on of the sheet and it's combo Epargne :


Private Sub Epargnes_Click()
CallByName ActiveSheet, ActiveSheet.Cells(1, 10).Value, VbMethod
End Sub

Sub épargnes_tout()
Unprotect ThisWorkbook.SIGPWD
Rows("1:100").Hidden = False ' Affiche toutes les lignes
Rows("15").Hidden = True ' Masque les lignes T12
Rows("21").Hidden = True ' Masque les lignes T12
Rows("27").Hidden = True ' Masque les lignes T12
Rows("33").Hidden = True ' Masque les lignes T12
Rows("39").Hidden = True ' Masque les lignes T12
Rows("45").Hidden = True ' Masque les lignes T12
Rows("57").Hidden = True ' Masque les lignes T12
Rows("41:46").Hidden = True ' Masque les Ã* déterminer
Protect ThisWorkbook.SIGPWD
End Sub

Sub épargnes_seul()
Unprotect ThisWorkbook.SIGPWD
Rows("1:100").Hidden = False ' Affiche toutes les lignes
Rows("15").Hidden = True ' Masque les lignes T12
Rows("21").Hidden = True ' Masque les lignes T12
Rows("27").Hidden = True ' Masque les lignes T12
Rows("33").Hidden = True ' Masque les lignes T12
Rows("39").Hidden = True ' Masque les lignes T12
Rows("45").Hidden = True ' Masque les lignes T12
Rows("57").Hidden = True ' Masque les lignes T12
Rows("47:51").Hidden = True ' Masque les comptes inactif
Rows("41:46").Hidden = True ' Masque les Ã* déterminer
Protect ThisWorkbook.SIGPWD
End Sub

Sub épargnes_compte()
Unprotect ThisWorkbook.SIGPWD
Rows("1:100").Hidden = False ' Affiche toutes les lignes
Rows("11:46").Hidden = True ' Masque toutes les lignes épargnes
Rows("52:63").Hidden = True ' Masque la fin du rapport
Rows("29:46").Hidden = True ' Masque les Ã* déterminer
Protect ThisWorkbook.SIGPWD
End Sub

On excel's version prior to 2003, everything works find. The click event is
fired once when I chose an option of the combo and it then calls the
appropriate function.

On Excel 2003, the following error message occurs when I make a combo choice :

Run-Time error '1004' : Application-defined or object-defined error

and if I check the err.description, I get : Unable to set the Hidden
property of the range class.

The subs works well indepedently if I comment the event. On the debugger,
the difference between Excel 2003 and the other versions is that the event is
triggered multiple times in excel 2003 and only one time in the other
versions!

A simple solution is to use a boolean to know when to call the function
(only once) but we have over a 100 sheets similar at this one so that would
imply a lot of work. I'm currently trying to help someone who's installing
this in Madagascar... Is there anything else to do?

Thanks for your help

Richard
 
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
Cannot seem to Cancel EXCEL App Right Click Event using C# Nick Biggs Excel Programming 18 October 28th 09 08:16 AM
Can VSTO handle a Picture click event in Excel? Yuhong Excel Programming 0 December 3rd 04 05:37 PM
Click event to run only once gavmer[_92_] Excel Programming 1 October 8th 04 07:23 AM
Click event to run only once gavmer[_88_] Excel Programming 1 October 6th 04 12:52 PM
Double-click event question, part 2 (Excel 97) Bob Wall Excel Programming 1 September 11th 04 03:50 AM


All times are GMT +1. The time now is 06:33 AM.

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

About Us

"It's about Microsoft Excel"