I
in-over-his-head-bill
I am trying to create a new workbook out of vba. When I try to name it
something beside the default book1,book2, etc... I get a "can't assign to
read-only property" error. How do I name a new workbook?
My code follows with public variables savetofile and savetorange
Public Sub manageoutput_new()
Dim mywb As Workbook, myws As Worksheet
Set mywb = Workbooks.Add
'* problem line is next
mywb.Name = savetofile
mywb.Activate
Set myws = Worksheets.Add
myws.Name = savetorange
End Sub
something beside the default book1,book2, etc... I get a "can't assign to
read-only property" error. How do I name a new workbook?
My code follows with public variables savetofile and savetorange
Public Sub manageoutput_new()
Dim mywb As Workbook, myws As Worksheet
Set mywb = Workbooks.Add
'* problem line is next
mywb.Name = savetofile
mywb.Activate
Set myws = Worksheets.Add
myws.Name = savetorange
End Sub