ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open , Save, and Close Macro (https://www.excelbanter.com/excel-programming/402698-open-save-close-macro.html)

[email protected]

Open , Save, and Close Macro
 
I want to be able to open a workbook that is currently open by another user
on a shared network by using a macro. I then want the macro to automatically
select ok when prompted about being a read only and then to select update.
Next, the macro should save the file as a different file name, possibly in a
different location. I then want to close the file. Is it possible to
automate this?

Thanks

Adam Bush


Dave Peterson

Open , Save, and Close Macro
 
Take a look at workbooks.open in VBA's help. You'll see that you can tell your
code to open the workbook in readonly mode:

Dim wkbk as workbook

Set wkbk = Workbooks.Open(Filename:="somepathfilenamehere.xls ", _
ReadOnly:=True)

wkbk.SaveAs Filename:="yournewpathfilenamehere"

wkbk.Close savechanges:=false



wrote:

I want to be able to open a workbook that is currently open by another user
on a shared network by using a macro. I then want the macro to automatically
select ok when prompted about being a read only and then to select update.
Next, the macro should save the file as a different file name, possibly in a
different location. I then want to close the file. Is it possible to
automate this?

Thanks

Adam Bush


--

Dave Peterson


All times are GMT +1. The time now is 02:08 AM.

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