Hi
I have a form with a combobox that contains 1,2,3,4
I need to create a work worksheet at Runtime and assign it the following properties.
Name = "Week" & the value of combobox
CodeName = "wks"& Worksheet name
I get a compile error on the CodeName ( Can't assign to read only property)
Here is my code:
Private Sub CreateWorksheet()
Dim wks As Excel.Worksheet
Set wks = Excel.Sheets.Add
With wks
.Name = "Week" & frmPrinters.cboWeek.Text
.CodeName = "wks" & .Name
End With
End Sub
Please assist
I have a form with a combobox that contains 1,2,3,4
I need to create a work worksheet at Runtime and assign it the following properties.
Name = "Week" & the value of combobox
CodeName = "wks"& Worksheet name
I get a compile error on the CodeName ( Can't assign to read only property)
Here is my code:
Private Sub CreateWorksheet()
Dim wks As Excel.Worksheet
Set wks = Excel.Sheets.Add
With wks
.Name = "Week" & frmPrinters.cboWeek.Text
.CodeName = "wks" & .Name
End With
End Sub
Please assist