Jump to content

Build Theme!
  •  
  • Infected?

WE'RE SURE THAT YOU'LL LOVE US!

Hey there! :wub: Looks like you're enjoying the discussion, but you're not signed up for an account. When you create an account, we remember exactly what you've read, so you always come right back where you left off. You also get notifications, here and via email, whenever new posts are made. You can like posts to share the love. :D Join 93098 other members! Anybody can ask, anybody can answer. Consistently helpful members may be invited to become staff. Here's how it works. Virus cleanup? Start here -> Malware Removal Forum.

Try What the Tech -- It's free!


Photo

VBA Runtime error 401

vba excel modeless forms

  • Please log in to reply
5 replies to this topic

#1 K e n

K e n

    New Member

  • Authentic Member
  • Pip
  • 11 posts

Posted 21 April 2014 - 03:24 AM

Can one of you kind experts please point me (VBA dilettante) in the right direction?

 

Situation:

I have made an Excel workbook for a user who has no idea about Excel and who should not come into contact with it. The WB has two sheets, one a list of ITEMS, and one a list of CONTAINERS.

On activating a sheet a non-modal form is called containing command buttons for sheet-appropriate subroutines such as entering new items/containers, deleting same, editing data, searching for keywords in the lists, printing hard copy, changing to other page...  The command buttons each fire a dialogue box shown modally on top of the non-modal menu form. Each modal form (dialogue box) must, of course, be closed after carrying out its tasks in the appropriate list and before the user can start a new task or access the excel cells directly in any way. On deactivation of a sheet, the menu form (non-modal) is unloaded (to refresh/update its labels).

 

Problem:

This set-up works OK in general, but in certain sets of circumstances which I cannot fathom, when calling up the modeless menu list in the Worksheet_Activate() event on changing from one page to the other, the makro gives me a runtime error 401 message ("Can't show non-modal form when modal form displayed") and th edebug option marks the command line "frmITEMS.show vbmodeless" or "frmCONTAINERS.show vbmodeless resp.. I understand the message all right; but I cannot locate any modal form being displayed.

 

Questions:

What are the commands to run through the opened forms and list their names? If I knew which forms were causing the hitch, I might get closer to a solution.

 

What might be causing the problem and what can I do to avoid it?

 

Cheerio

 

Ken

 

 

 

 


    Advertisements

Register to Remove


#2 paws

paws

    Tech Team

  • Administrator
  • 6,088 posts

Posted 25 April 2014 - 06:14 AM

Hi Ken, I noticed that no one had yet responded to your post, so thought I'd take a look.

Are you sure this is not a business issue?

We tend to deal, here on the WTT forum with folks' private computers used for non business purposes leaving people with business type issues to consult their usual IT adviser or buy in the expertise from a consultant who deals in these areas.

Have a look at the Terms of Use... here's an extract:

"What the Tech is a family friendly site, accessible to anyone over 13 years of age. Please keep all content appropriate.
We offer free computer help and tech support for home and personal use. We are not here to support others that work for profit, or to support/replace your company's IT department."


Post back if I have misunderstood the situation.
Regards
paws


The help you receive here is free. If you wish to show your appreciation, then you may donate to help keep us online. http://www.whatthetech.com/donate

#3 K e n

K e n

    New Member

  • Authentic Member
  • Pip
  • 11 posts

Posted 27 April 2014 - 01:05 AM

Hello, Paws.

Not business. I'm making a household inventory for my wife, who hates to have anything out of her sight; trouble is she gets easily discouraged when faced with computer programmes like Access or Excel. So I'm trying to present her with a very simple interface and with lists of household and clothing items, what containers they're stored in and where these containers are in the attic.

 

As far as the problem is concerned, I seem to have found a solution by accident. At least, the error message and its cause have not appeared in several days. Before that it was driving me nuts.

 

Thanks for picking up the ball, here, by the way. I thought my question must have been so boring that everybody was ignoring it (maybe that's still true!).

 

Regards

 

K e n



#4 paws

paws

    Tech Team

  • Administrator
  • 6,088 posts

Posted 27 April 2014 - 01:19 AM

 Hi Ken
Thanks for the extra information, and glad to hear you got it fixed.

:thumbup:

 

If any other folks are suffering, trying to figure out a similar issue, it would be great if you could post back with the steps that worked for you...

 

The search engines will then index it and maybe other folks will bless the name of Ken if it helps them with their issues.

Regards

paws


The help you receive here is free. If you wish to show your appreciation, then you may donate to help keep us online. http://www.whatthetech.com/donate

#5 K e n

K e n

    New Member

  • Authentic Member
  • Pip
  • 11 posts

Posted 27 April 2014 - 02:03 AM

Well, Paws, I don't really know what I did.

Possibly, because of my working on two monitors simultaneously and in debug mode, I had been failing to see that a dialogue box (modal) was in fact open; when the code window was activated for editing, any dialogue box positioned on the same monitor got concealed behind it  and I had been thinking it had been unloaded or "hidden" (in the VBA sense). This would, of course, be in line with the sense of the error message.

 

Regards

 

K e n

 



#6 paws

paws

    Tech Team

  • Administrator
  • 6,088 posts

Posted 27 April 2014 - 03:10 AM

Ok

All understood Ken

Thanks for responding

:thumbup: 

Regards

paws


The help you receive here is free. If you wish to show your appreciation, then you may donate to help keep us online. http://www.whatthetech.com/donate

Related Topics




Also tagged with one or more of these keywords: vba, excel, modeless forms

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users