Bairn90
New Member
- Joined
- Jun 2, 2012
- Messages
- 28
Hi Guys,
I am completely stumped by this one and in desperate need of help. I have a macro that on close "should" share the workbook if not currently shared. When I run through the code not closing the book, it shares the book. When I close the book I can see it having been shared in the name but when I re-open the spreadsheet low and behold it's not shared.
Anybody know why this is happening?
I am completely stumped by this one and in desperate need of help. I have a macro that on close "should" share the workbook if not currently shared. When I run through the code not closing the book, it shares the book. When I close the book I can see it having been shared in the name but when I re-open the spreadsheet low and behold it's not shared.
Anybody know why this is happening?
Code:
Sub Auto_Close()
Dim myname, mypath As String
Application.DisplayAlerts = False
ThisWorkbook.Activate
If ThisWorkbook.MultiUserEditing Then
End
Else
Sheets("Invoice Run Requests").Shapes.Range(Array("Button 4")).Visible = False
Sheets("Invoice Run Requests").Protect "*********", 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0
ThisWorkbook.Save
mypath = ThisWorkbook.path
myname = ThisWorkbook.name
ChDir mypath
ActiveWorkbook.SaveAs Filename:=myname, FileFormat:=52, Accessmode:=xlShared
ThisWorkbook.Save
End If
Application.DisplayAlerts = True
End Sub