Opening and closing workbooks

b-radexcel

New Member
Joined
May 9, 2006
Messages
25
hi all-

I have a small vba app where I open existing workbooks and copy certain ranges onto a new workbook - basically compiling data.

I am using Workbooks.Open Filename:=file_Name, UpdateLinks:=0, ReadOnly:=True to open files. the problem is, when i close workbook.close excel keeps prompting me if I want to save changes. Excel also asks if I want to update links when I open these files. Is there a way to activate these workbooks without getting prompts?
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

Smitty

Legend
Joined
May 15, 2003
Messages
29,536
You can use Application.DisplayAlerts = False to suppress messages, just set it to True at the end as the VBE won't reset it.

As for the Links prompt you can goto Tools-->Options-->Edit -->Uncheck "Ask to Update Automatic Links".

Smitty
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
59,025
Office Version
  1. 365
Platform
  1. Windows
There are a few ways. One is to use this line before that step:

Application.DisplayAlerts = False

Then you can turn it backon afterwards with:

Application.DisplayAlerts = True
 

Forum statistics

Threads
1,141,417
Messages
5,706,312
Members
421,441
Latest member
VapesRub

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
Top