Open , Save, and Close Macro

A

adambush4242

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
 
D

Dave Peterson

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top