open close with VBA

chef

Well-known Member
Joined
Jul 10, 2002
Messages
544
Office Version
365, 2016
Hoping for some guidance and tried looking at dummies VBA but not managing to get right

I have a workbook called interface

there are various options say 1 -25 and if the user clicks on say Dundee Information which may be option 9, it opens up dundee informaion
I then have a home icon on this dundee information workbook which then hyperlinks back to the interface workbook.
That works fine but it stays open and all 25 can be opened then manually have to be closed down.

I put in the following
sub applclose()
Application.quit
End Sub

That allows be to attached a macro to the home icon but closes excel down completely and I want to return to the interface workbook

Is there a way I can have the home icon close down just that file that is opened and also return to interfaco workbook?

It allows me to attach a marco or a hyperlink but not both and I only want the user to open up file, then when fininished(its read only), then close down that file but then return to the interface book and other options.

Hope that makes sense
regards
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
40,524
Office Version
365
Platform
Windows
Try
Code:
Sub applclose()
Application.DisplayAlerts = False
ThisWorkbook.Close , False
Application.DisplayAlerts = True
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,098,859
Messages
5,465,113
Members
406,412
Latest member
superjoejoe

This Week's Hot Topics

Top