![]() |
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 |
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 |
Creating a new excel file programatically
I want to save only the active worksheet...
regards Chimanrao |
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 |
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 |
All times are GMT +1. The time now is 01:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com