Code to share a file

I

iashorty

I have written a macro to take one sheet from the file and save it. It is
password protected and I need to have it shared. How do I include the sharing?

OpOutputSave = Sheet3.Range("B35")
Sheets(Array("sheet 1", "sheet 2")).Select
Sheets("Sheet 2").Activate
Sheets(Array("Sheet 1", "sheet 2")).Copy
Sheets("Sheet 2").Select
Sheets("Sheet 2").Move Before:=Sheets(1)
ActiveWorkbook.SaveAs Filename:=OpOutputSave, FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False
ActiveWindow.Close
 
J

Joel

from:
ActiveWorkbook.SaveAs Filename:=OpOutputSave, FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

to:

ActiveWorkbook.SaveAs Filename:=OpOutputSave, FileFormat:=xlNormal _
, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False, AccessMode:=xlShared
 
I

iashorty

Thank you. And what would the code be to take it off when I go to use it.

Workbooks.Open Filename:=Filename, ReadOnly:=False, Password:=""

where Filename has been determined.

IAShorty
 
J

Joel

XlSaveAsAccessMode can be one of these XlSaveAsAccessMode constants.

xlExclusive (exclusive mode)
xlNoChange default (don't change the access mode)
xlShared (share list)

If this argument is omitted, the access mode isn't changed. This argument is
ignored if you save a shared list without changing the file name. To change
the access mode, use the ExclusiveAccess method.
 

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

Similar Threads


Top