LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default A problem with creating a workbook by VBA

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!
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a workbook Mac Excel Discussion (Misc queries) 3 June 11th 08 02:45 AM
Creating a drop box in a workbook. Mark Excel Discussion (Misc queries) 1 January 19th 07 10:14 PM
creating directory for workbook Renee Excel Discussion (Misc queries) 3 August 28th 06 10:00 AM
Creating a log in a workbook barry Excel Discussion (Misc queries) 1 July 5th 06 08:11 PM
Creating a new workbook. sungen99[_2_] Excel Programming 2 May 6th 04 08:40 PM


All times are GMT +1. The time now is 02:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"