open close with VBA

chef

Well-known Member
Joined
Jul 10, 2002
Messages
610
Office Version
  1. 365
  2. 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
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try
Code:
Sub applclose()
Application.DisplayAlerts = False
ThisWorkbook.Close , False
Application.DisplayAlerts = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,847
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top