Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Creating a new excel file programatically

I am writing a plugin with which , when the user clicks a button, I
want to save the active sheet in a new excel file.

How do I create a new excel file programatically?
howo do I add a existing sheet to this file?

Regards
Chimanrao

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Creating a new excel file programatically

In the simplest form use.......

ActiveWorkbook.SaveAs Filename:="C:\Copy of Book.xls"

Sheets.Add

--
Cheers
Nigel



"Chimanrao" wrote in message
oups.com...
I am writing a plugin with which , when the user clicks a button, I
want to save the active sheet in a new excel file.

How do I create a new excel file programatically?
howo do I add a existing sheet to this file?

Regards
Chimanrao



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Creating a new excel file programatically

I want to save only the active worksheet...

regards
Chimanrao

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Creating a new excel file programatically

Try:

Sub newbook()
ActiveSheet.Copy
ActiveWorkbook.SaveAs "c:\Temp\MyNewBook.xls"
End Sub

Hope this helps
Rowan

Chimanrao wrote:
I want to save only the active worksheet...

regards
Chimanrao

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Creating a new excel file programatically

Sheets("Sheet1").Select
Sheets("Sheet1").Copy
Sheets.Add
ActiveWorkbook.SaveAs Filename:="C:\new book.xls"

--
Cheers
Nigel



"Chimanrao" wrote in message
oups.com...
I want to save only the active worksheet...

regards
Chimanrao





Reply
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
programatically creating dialog box [email protected] Excel Programming 1 March 20th 05 10:51 PM
Creating a PDF file programatically from Excel Chaplain Doug Excel Discussion (Misc queries) 0 December 16th 04 08:49 PM
Programatically Creating a Hyperlink Using VB.Net ? eBob.com Excel Programming 1 December 4th 04 03:42 AM
Creating a hyperlink in a excel cell programatically sameershenoy Excel Programming 0 May 12th 04 06:12 AM
Programatically saving an excel .csv file to .xls file... Pai Excel Programming 1 December 2nd 03 05:18 AM


All times are GMT +1. The time now is 01:55 PM.

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

About Us

"It's about Microsoft Excel"