View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] semiold@tele2.se is offline
external usenet poster
 
Posts: 1
Default Error Loading UserForm

There is some bug causing the userform to crash to file. It suddenly
fails to recognize one or two of the userforms and/or reports the
error you have described. When trying to save, that is not possible.
I have a solutions with 10+ userforms, references to other libraries
and a couple of modules. I have suspected the scheduled backup of file
to have something to do with it but am I not sure. If closing the file
when picking up a cup of coffee it works fine, if leaving it even for
a short while (being idle) something has happend.

When Office 97 was released (that old, yes) I had great problems with
the userform in Word in SP-1. Learned to never save when the userform
while visible in the VB-editor. Okay to save from a code windows. Have
tried this method this time as well during some 40-50 hours spent on
the file in Office 2007 on Vista. Don't think that makes a difference
this time around.

Also found that opening the main file, from WinExplorer, while the xl?
b-file was opened, caused the original file to open in a different
instance of Excel. Realized it as I attempted to copy a module/
userform in the VB-editor. Two files open but only one visible in the
project window. Switched to the other and realized the problem. Closed
the main file and opened it from Excel and had them in the same
instance. Something is not working properly.

Regards
AK Bohman
(remove dots and garbage in the emailaddress)
www.buab.se

When leaving th
On 31 Okt, 12:39, "Jim Cone" wrote:
Some general comments...
1. Hide a user form instead of unloading if you are going to display it multiple times.
2. Unload it when done with it.
3. Auserformis loaded automatically when it is referenced...
UserForm13.TextBox1.Value = "Mush" - loads the form.
4. Code like this can help unload multiple userforms...

lngCounter = UserForms.Count
If lngCounter 0 Then
For N = 1 To lngCounter
Unload UserForms(N - 1)
Next
End If

5. Pioneers can get arrows in the back. (xl2007)
--
Jim Cone
San Francisco, USAhttp://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"ZipCurs"
wrote in message
I eager to get some help and am resubmitting this from yesterday... I have a
macro with about 20 userforms. As far as I can tell, it worked great in
earlier versions of Excel. I am now using the macro on a new machine with
Excel2007. After I call the exact same sub-routine a bunch of times, I get:

Run-timeerror'75': Could not find specified object.

The debugger highlights "Load UserForm13". I can see it is right there in
VB interface and it had just accessed it 3-20 times prior to failing. I
can't open it though. There is a lot of other code, so I haven't bothered to
provide this.

Any help or guidance would greatly be appreciated. Thank you
in advance.