Hi All,
I am struggling a bit in Access VBA. I export files from Access vba and then open the file and do some formatting and then password protect that excel file. However I want the user to able to edit two columns. I try below code but it is not doing the job. It gives me runtime error 1004 Method ‘Columns’ of object’_Global failed. Please help
With xlApp
.Visible = False
.Workbooks.Open (outpath + outfile1)
.ActiveSheet.Protection.AllowEditRanges.Add Title:="myRange", Range:=Columns("O
"), Password:="pass"
End with
Thanks,
Peace
I am struggling a bit in Access VBA. I export files from Access vba and then open the file and do some formatting and then password protect that excel file. However I want the user to able to edit two columns. I try below code but it is not doing the job. It gives me runtime error 1004 Method ‘Columns’ of object’_Global failed. Please help
With xlApp
.Visible = False
.Workbooks.Open (outpath + outfile1)
.ActiveSheet.Protection.AllowEditRanges.Add Title:="myRange", Range:=Columns("O

End with
Thanks,
Peace