-
Solved: wb close and form close
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?
-
[vba] Application.CutCopyMode = False
wb.Close False[/vba]
The Form is call FrmTotals is there a way I can have something like this
[vba] Application.CutCopyMode = False
wb.Close False
unload FrmTotals[/vba]
Last edited by Emoncada; 06-12-2009 at 09:23 AM.
-
Why not stop the form from showing in the first place?
-
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.
-
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.
[vba]
Application.EnableEvents = False
' code that opens workbooks
Application.EnableEvents = True
[/vba]
-
YEEESSSSS!!!!!!!! Norie Perfect that worked Thanks For you help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules