Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 168
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to open, Update links, save and close workbooks Anton Excel Discussion (Misc queries) 0 January 7th 10 03:18 AM
macro to run on first open after save and close pswanie Excel Programming 2 June 17th 07 07:44 PM
Auto Open, Refresh, Save, Close Jimmycooker Excel Discussion (Misc queries) 0 February 6th 06 01:34 PM
Open Save & Close All Files in Dir Diane Alsing Excel Programming 5 January 31st 05 07:47 PM
Automate open file, update links, run macro, close and save file Geoff[_7_] Excel Programming 2 August 26th 03 10:13 PM


All times are GMT +1. The time now is 02:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"