Worksheets.Add method
I have tried to add a worksheet with the following code.
dim oDoc as Workbook
dim oSht as Worksheet
Set oDoc = Application.ThisWorkbook
oSht = oDoc.Worksheets.Add
It gives an error #1004. I have tried it in many variations but all fail.
Some even create the sheet but still error out. Any help would be
appreciated.
|