Hello all,
I'm trying to open a shared workbook, do some manipulations to it that can't be done if in shared mode, then save it as shared once again...My thought process was this:
1) Open and unshare
2) Perform necessary steps
3) Save again as shared
For some reason in a XL 2007 code module when I use this code I get an error saying I can't access the workbook:
But if I do this, it works just fine:
Any ideas?
I'm trying to open a shared workbook, do some manipulations to it that can't be done if in shared mode, then save it as shared once again...My thought process was this:
1) Open and unshare
2) Perform necessary steps
3) Save again as shared
For some reason in a XL 2007 code module when I use this code I get an error saying I can't access the workbook:
Code:
''''''''''''VARIOUS CODE
Workbooks.Open(MyFolder & "\" & MyDate & "_Monthly_BS_Review.xls").ExclusiveAccess
''''''''''''VARIOUS CODE
ActiveWorkbook.SaveAs Filename:=MyFolder & "\" & MyDate & "_Monthly_BS_Review.xls", AccessMode:=xlShared, FileFormat:=xlExcel8
Code:
''''''''''''VARIOUS CODE
Workbooks.Open(MyFolder & "\" & MyDate & "_Monthly_BS_Review.xls").ExclusiveAccess
''''''''''''VARIOUS CODE
[B]ActiveWorkbook.SaveAs "TESTWORKBOOK.xls"[/B] ''''''UNNECESSARY STEP?
ActiveWorkbook.SaveAs Filename:=MyFolder & "\" & MyDate & "_Monthly_BS_Review.xls", AccessMode:=xlShared, FileFormat:=xlExcel8