PDA

View Full Version : Userform hidden and my macro stops



Tezzies
02-14-2008, 12:14 PM
This is a strange problem that seems to have crept into a project I'am working on. I'll give a brief description and if this rings any alarm bells please feel free to enlighten me because I am really stumped.

I have a workbook called main.xls. It has a userform which has a series of combo boxs and buttons which when pressed opens another workbook called test.xls. Once opened test.xls does some stuff then closes itself. Once closed i expect my userform which is embedded in main.xls to be visible again. Instead sheet1 from main.xls is visible and any macros within Main.xls do not continue. BUT If I repeat the process and step through slowly using F8 it works as expected :dunno.

Is there a setting or update required or maybe a line of code missing to cure this hopefully common fault.

many thanks

Tezzies
02-14-2008, 01:04 PM
After some extensive searching, could the draw buffer have anything to do with it. My userform does have 6 frames on it.:clever:

Paul_Hossler
02-14-2008, 07:03 PM
Guessing, but

maybe some piece of code somewhere is making assumptions about the wb that it's supposed to act on, or

maybe the 'called' wb has to be closed or the first one .Activate-d before the code can continue

when I'm dealing with multiple wb open at the same time, I always completely qualify the specific wb that I want something to happen to: e.g.


Set wbSrc = Workbooks("File1.xls")
wbSrc.worksheets("Data").cells(1,2).value = 123


instead of Activeworkbook.Worksheets .... or Range( )

I'd be surprised if it were the Draw buffer, but then again, this is Excel :banghead:

Paul

Just some thoughts