Below is the code I use to add a new workbook - but How can I assign a name to the new workbook - If I try to use the .Name property - I am told readOnly. Any help is appreciated.
Code:Dim NewBookX As Workbook Set NewBookX = Workbooks.Add
Below is the code I use to add a new workbook - but How can I assign a name to the new workbook - If I try to use the .Name property - I am told readOnly. Any help is appreciated.
Code:Dim NewBookX As Workbook Set NewBookX = Workbooks.Add
xl2007 - Windows 7
xl hates the 255 number
Hi,
Would this work ?
Code:Dim NewBookX As Workbook Set NewBookX = Workbooks.Add If NewBookX.ReadOnly Then NewBookX.ChangeFileAccess Mode:=xlReadWrite NewBookX.Name = "NewName" End If
ahhh - great - thanks
xl2007 - Windows 7
xl hates the 255 number
Try this....
Code:Dim wbkNew As Workbook Workbooks.Add(xlWorksheet).SaveAs Filename:="NewName", FileFormat:=&H34 '33 = XLSX, 34 = XLSM Set wbkNew = Workbooks("NewName.xlsm") With wbkNew .ChangeFileAccess xlReadOnly Kill .FullName End With
A dream is not something you see when you are asleep, but something you strive for when you are awake.
It's usually a bad idea to say that something can't be done.
The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve
Join us at Facebook
Will do - the other one did not like a full compile - thanks
xl2007 - Windows 7
xl hates the 255 number
Bookmarks