Hi, So i have this code that copies a sheet and then moves it to another workbook make some formatting changes and then save it's name by the values of Cell B1 and J1.
The error i am facing is that there is some kind of sharing violation.
Could somone have a look ? is there a shorter way to do do this ? Thanks in advance.
Sub CreateBill_Print()
'
' CreateBill_Print Macro
'
'
Columns("A:M").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
ActiveSheet.Select
Application.CutCopyMode = False
ActiveSheet.Move
Rows("4:4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.RowHeight = 13
Selection.End(xlUp).Select
Range("B6").Select
ChDir _
"/Users/asif/Library/Mobile Documents/com~apple~CloudDocs/Work/LNL/1/Cash Invoice/"
ActiveWorkbook.SaveAs FileName:= _
"/Users/asif/Library/Mobile Documents/com~apple~CloudDocs/Work/LNL/1/Cash Invoice/" & Range("B1").Value & "" & Range("J1").Value & "" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
Range("B4").Select
End Sub