W
wangww
Hi
I know example1 is right, example2 is wrong.
Please tell me, why is the second example wrong?
Following is my code:
Example(1)
Public Sub CreatWB()
Set NewBook = Workbooks.Add
NewBook.SaveAs Filename:="D:\111"
End Sub
Example(2)
Public Sub CreatWB()
Set Newbook = Workbooks
Newbook.Add
Newbook.SaveAs Filename:="D:\111"
End Sub
Thanks in advance for any help!
I know example1 is right, example2 is wrong.
Please tell me, why is the second example wrong?
Following is my code:
Example(1)
Public Sub CreatWB()
Set NewBook = Workbooks.Add
NewBook.SaveAs Filename:="D:\111"
End Sub
Example(2)
Public Sub CreatWB()
Set Newbook = Workbooks
Newbook.Add
Newbook.SaveAs Filename:="D:\111"
End Sub
Thanks in advance for any help!