PDA

Click to See Complete Forum and Search --> : ?Excel: How to SaveAs workbook as SHARED?


Webtest
Oct 4th, 2004, 02:32 PM
Esteemed Forum Participants and Lurkers:

I have a requirement to save a set of macro generated Excel single-sheet workbooks as SHARED workbooks. I don't have any problem at all saving the required files ... I just don't know how to set the SHARED property.

Here is what I have so far:
ActiveWorkbook.SaveAs _
fileName:=myPath & myName, _
FileFormat:=xlNormal, _
Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=False

I tried to record a macro to save a SHARED file, but this is not allowed. The macro gets closed and does not reveal any information about saving as Shared. I of course rummaged throug my reference books and did a search on this forum, all to no avail.

Thank you for any and all comments, suggestions, and
assistance.

RobDog888
Oct 5th, 2004, 12:08 PM
To save a workbook as a shared workbook.

expression.SaveAs(FileName, FileFormat, Password, WriteResPassword, ReadOnlyRecommended, CreateBackup, AccessMode, ConflictResolution, AddToMru, TextCodepage, TextVisualLayout, Local)

AccessMode optional XlSaveAsAccessMode.

XlSaveAsAccessMode can be one of these XlSaveAsAccessMode constants.
xlExclusive (exclusive mode)
xlNoChange default (dont change the access mode)
xlShared (share list)
If this argument is omitted, the access mode isnt 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.

Example:
Workbooks("Book1.xls").SaveAs "C:\MySharedWorkBook.xls", , , , , , xlSharedHTH

Webtest
Oct 11th, 2004, 10:36 AM
Thanks RobDog ...

I don't know how I missed that in the Help Heap. I guess I read it too quickly.

RobDog888
Oct 11th, 2004, 11:34 AM
No prob.

:)