Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Glenn Duncan   on Aug 25 In MS Office Category.

  
Question Answered By: Haya Yoshida   on Aug 25

You are possibly getting misled by the "with" statement. Your code  is
equivalent to

> Set newWB = Workbooks.Add
> WB.Title = "Yield Curves"
> WB.Subject = "Yield Curves"
> Call WB.SaveAs(Filename:="c:\foo.xls")

which is more specific (and two lines shorter),

The important thing to note is that there are actually four separate
statements here, not one multi-line call with several parameters.

If you don't want to save  the file, just remove the SaveAs call.

You do say "create a workbook  and name it". Workbooks are files. They
don't have separate names  - they use the files' names. So, it won't have a
name other than "Book1" until it's saved. (This is similar to other
programs that have a File/New facility - like Word, NotePad, etc.)

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on setting the name in a workbook Or get search suggestion and latest updates.


Tagged: