sgmpatnaik
Active Member
Hi
i got this code from the google search, kindly advise me about this code why the code is working in normal mode and not in Workbook Share Mode
and correct the code for work in normal and in Workbook Share mode also
[pre]
[/pre]
Thanks
SP
i got this code from the google search, kindly advise me about this code why the code is working in normal mode and not in Workbook Share Mode
and correct the code for work in normal and in Workbook Share mode also
[pre]
Code:
Sub NewCopy()
Dim strFileName As String
Dim range1 As Range
Dim rng1 As Range, rng2 As Range, myMultiRanges As Range
Worksheets("Sheet1").Activate
Set rng1 = Range("A1:E7")
Set rng2 = Range("A80:E86")
Set myMultiRanges = Union(rng1, rng2)
myMultiRanges.Select
strFileName = InputBox("Type a name for the new workbok", "File Name")
If Trim(strFileName) = vbNullString Then Exit Sub
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Selection.Copy
Sheets.Add.Range("A1").PasteSpecial xlPasteAll
Application.CutCopyMode = False
ActiveSheet.UsedRange.EntireColumn.AutoFit
ActiveSheet.Move
ActiveWorkbook.SaveAs "C:UsersDesktop" & strFileName & ".xlsm", xlOpenXMLWorkbookMacroEnabled
ActiveWorkbook.Close False
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Thanks
SP