PDA

View Full Version : Solved: wb close and form close



Emoncada
06-12-2009, 09:05 AM
I have a spreadsheet then when closed it shows a form then need to close that form to close spreadsheet.

Now I have a macro to open several spreadsheets in a folder pulls data and closes, but the problem is i need to click close on the form on each spreadsheet for it to go to the next spreadsheet.

is there a script that I can put to auto close that form and I don't manually need to click close?

Emoncada
06-12-2009, 09:12 AM
Application.CutCopyMode = False
wb.Close False

The Form is call FrmTotals is there a way I can have something like this

Application.CutCopyMode = False
wb.Close False
unload FrmTotals

Norie
06-12-2009, 09:39 AM
Why not stop the form from showing in the first place?

Emoncada
06-12-2009, 09:41 AM
That will work how can I do that.

Note I am using a master Sheet that pulls multiple sheets with the form in it. So the Master needs to be able to tell it to either close form after opened or not open form at all.

Norie
06-12-2009, 09:57 AM
Well I don't know how you would do it because I don't know how the forms are being displayed.

If it's when the workbook opens and uses the workbook open event then try turning off events.

Application.EnableEvents = False

' code that opens workbooks

Application.EnableEvents = True

Emoncada
06-12-2009, 09:59 AM
YEEESSSSS!!!!!!!! Norie Perfect that worked Thanks For you help.