ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   open as read only (https://www.excelbanter.com/excel-programming/336912-open-read-only.html)

Newbie80[_11_]

open as read only
 

Im opening a different workbook and Im copying a sheet from it. Thought
I opened it as readonly, but sometimes it still asks if I want to save
the changes.

Set sourceWb = Workbooks.Open(filepath, True, False)
........
..............
(can I write something like sourceWb.Don'tSave or something)

sourceWb.Close


--
Newbie80
------------------------------------------------------------------------
Newbie80's Profile: http://www.excelforum.com/member.php...o&userid=25946
View this thread: http://www.excelforum.com/showthread...hreadid=394562


Tom Ogilvy

open as read only
 
sourceWb.Close SaveChanges:=False

--
Regards,
Tom Ogilvy


"Newbie80" wrote in
message ...

Im opening a different workbook and Im copying a sheet from it. Thought
I opened it as readonly, but sometimes it still asks if I want to save
the changes.

Set sourceWb = Workbooks.Open(filepath, True, False)
.......
.............
(can I write something like sourceWb.Don'tSave or something)

sourceWb.Close


--
Newbie80
------------------------------------------------------------------------
Newbie80's Profile:

http://www.excelforum.com/member.php...o&userid=25946
View this thread: http://www.excelforum.com/showthread...hreadid=394562





All times are GMT +1. The time now is 01:29 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com