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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,601
Messages
6,120,462
Members
448,965
Latest member
grijken

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