Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
GD GD is offline
external usenet poster
 
Posts: 83
Default Problem with ComboBoxes

I've have a recurrent problem in a somewhat huge Excel Vba application.

For 3 (out of more than a hundred) comboboxes, defining listindex doesn't
work anymore. It is not the last three controls in my form (not even the last
three comboboxes).
To be more precise, it works the first time, after i've made modifications
in VBA but it doesn't work anymore if i save the file, quit Excel and rerun
it.
It works perfectly if debugger is on (ie i enter visual basic editor and
type the password which protects my project).
Error message is : -2147417848 (80010108) ListIndex Method for IMDcCombo
object has failed (La méthode 'ListIndex' de l'objet 'IMDcCombo' a échoué)
and is followed by an Excel crash...

If i comment the 3 lines of code involved, program runs smoothly, Comboboxes
are initialized (with Additem Method) and i can select manually every value.

Problem occurs with XL XP (Windows XP Pro), XL 2003 (Windows NT), XL 2007
(Vista) in compatibility mode.
Problem doesn't seem to occur with new XL 2007 format but if i convert the
file back to XL 2003 format problem reappears!

It does not seem to be related with unqualified Office references (as
described in MS Q319832 Bulletin : i do not use in my program other Office
applications, error is present after leaving Excel (it crashes :)), it runs
with no reference to Microsoft Office 11 object Library)

I've spent a lot of time to try to find a workaround without success...If
somebody has an idea I will try it!

Thanks

GD
  #2   Report Post  
Posted to microsoft.public.excel.programming
GD GD is offline
external usenet poster
 
Posts: 83
Default [SOLVED] Problem with ComboBoxes - sequel to KB 177842?

I finally fix it!

It seems to be a sequel of 177842 (see KB) problem which I already
encountered a few years ago.
In the last evolution of my application I added direct reference to some
controls (userform.controlname) intead of using the form
userform.controls.item(number) I had put in place for Excel 97 compatibility

but...

1) This time the limit is not 411 controls (I've currently 844 controls in 1
form - The lowest control tabindex which gave me problem is #784 - Control
#620 was adressed the same way but gave me no problem)
2) The error is not triggered when executing a line with a direct reference
but seems to be triggered on the first listindex setting statement (for
comboboxes) even if this statement is using the controls.item reference!!! It
seems to me, that as soon there is a somewhere in your code a line with a
direct reference to this sort of control you have the problem on the first
listindex line (so it's why I take so long time to think it could be this
problem).
In fact, I had the problem with a checkbox too... this time the error was on
the line using the direct reference (it was a great help for me to understand
:))
3) Last but not the least : first problem (177842) was restricted to Excel
97 and 2000. This one affects all Excel versions (so far I know) : Excel
2002, 2003, 2007 in compatibility mode....

Hope it could help! :)

GD

"GD" wrote:

I've have a recurrent problem in a somewhat huge Excel Vba application.

For 3 (out of more than a hundred) comboboxes, defining listindex doesn't
work anymore. It is not the last three controls in my form (not even the last
three comboboxes).
To be more precise, it works the first time, after i've made modifications
in VBA but it doesn't work anymore if i save the file, quit Excel and rerun
it.
It works perfectly if debugger is on (ie i enter visual basic editor and
type the password which protects my project).
Error message is : -2147417848 (80010108) ListIndex Method for IMDcCombo
object has failed (La méthode 'ListIndex' de l'objet 'IMDcCombo' a échoué)
and is followed by an Excel crash...

If i comment the 3 lines of code involved, program runs smoothly, Comboboxes
are initialized (with Additem Method) and i can select manually every value.

Problem occurs with XL XP (Windows XP Pro), XL 2003 (Windows NT), XL 2007
(Vista) in compatibility mode.
Problem doesn't seem to occur with new XL 2007 format but if i convert the
file back to XL 2003 format problem reappears!

It does not seem to be related with unqualified Office references (as
described in MS Q319832 Bulletin : i do not use in my program other Office
applications, error is present after leaving Excel (it crashes :)), it runs
with no reference to Microsoft Office 11 object Library)

I've spent a lot of time to try to find a workaround without success...If
somebody has an idea I will try it!

Thanks

GD

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
COMBOBOXES Zigball Excel Programming 1 December 19th 06 01:10 AM
ComboBoxes Zaahir Excel Programming 0 October 19th 06 02:16 PM
Filling comboboxes in loop - problem S³awcio.xww Excel Programming 2 August 29th 06 09:07 AM
Comboboxes Darren Excel Programming 1 January 23rd 05 05:35 PM
Invisible/unfindable Comboboxes creating .emf file problem... Wexler Excel Programming 0 January 2nd 04 05:13 PM


All times are GMT +1. The time now is 12:54 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"