PC Review


Reply
Thread Tools Rate Thread

Creating new workbook programmatically

 
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      14th Nov 2006
How do I create a new workbook programmatically and then assign it to aWB?

Thanks
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QUEyZTcyRQ==?=
Guest
Posts: n/a
 
      14th Nov 2006
Create With the Excel.Application object or WITHOUT it?

"Barb Reinhardt" wrote:

> How do I create a new workbook programmatically and then assign it to aWB?
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?RGF2ZSBSYW1hZ2U=?=
Guest
Posts: n/a
 
      14th Nov 2006
Not entirely sure what you are after, but here is a selection of wokboo and
worksheet creation stuff....

Sub Demo()
Dim wb as workbook
Dim ws as Worksheet

Set wb = Application.Workbooks.Add
wb.Sheets(1).Name = "test"
Set ws = wb.Worksheets.Add
ws.Range("A1").Formula = "test2"
wb.SaveAs "C:\test.xls"
wb.Close SaveChanges:=False
End Sub

Cheers,
Dave
"Barb Reinhardt" wrote:

> How do I create a new workbook programmatically and then assign it to aWB?
>
> Thanks

 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      14th Nov 2006
Thanks. That gave me what I needed.

"Dave Ramage" wrote:

> Not entirely sure what you are after, but here is a selection of wokboo and
> worksheet creation stuff....
>
> Sub Demo()
> Dim wb as workbook
> Dim ws as Worksheet
>
> Set wb = Application.Workbooks.Add
> wb.Sheets(1).Name = "test"
> Set ws = wb.Worksheets.Add
> ws.Range("A1").Formula = "test2"
> wb.SaveAs "C:\test.xls"
> wb.Close SaveChanges:=False
> End Sub
>
> Cheers,
> Dave
> "Barb Reinhardt" wrote:
>
> > How do I create a new workbook programmatically and then assign it to aWB?
> >
> > Thanks

 
Reply With Quote
 
=?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?=
Guest
Posts: n/a
 
      14th Nov 2006
We discovered the problem. There was a style that had a background included
in it.

"Dave Ramage" wrote:

> Not entirely sure what you are after, but here is a selection of wokboo and
> worksheet creation stuff....
>
> Sub Demo()
> Dim wb as workbook
> Dim ws as Worksheet
>
> Set wb = Application.Workbooks.Add
> wb.Sheets(1).Name = "test"
> Set ws = wb.Worksheets.Add
> ws.Range("A1").Formula = "test2"
> wb.SaveAs "C:\test.xls"
> wb.Close SaveChanges:=False
> End Sub
>
> Cheers,
> Dave
> "Barb Reinhardt" wrote:
>
> > How do I create a new workbook programmatically and then assign it to aWB?
> >
> > Thanks

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatically delete Module1 from a workbook =?Utf-8?B?QmFyYiBSZWluaGFyZHQ=?= Microsoft Excel Programming 1 29th Aug 2007 09:46 PM
How to programmatically add a digital signature to a workbook Monkeebob Microsoft Excel Programming 0 4th Mar 2005 07:19 PM
Closing a workbook programmatically Raul Microsoft Excel Programming 7 9th Oct 2004 01:24 PM
Close Workbook Programmatically Lucy Microsoft Excel Programming 3 30th Dec 2003 08:17 PM
Programmatically Email one Sheet from a Workbook Michael Microsoft Excel Worksheet Functions 1 30th Jul 2003 06:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:28 AM.