ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code to open new workbook, prompt for 'save as' name. (https://www.excelbanter.com/excel-programming/326869-code-open-new-workbook-prompt-save-name.html)

Mark

Code to open new workbook, prompt for 'save as' name.
 
I have created extensive code to derive reports off a current workbook.

What I want to do now is create a macro in my original workbook that will
open a new workbook, run my report code, and then prompt for a save_as name.

The most important part is really just getting a macro to open a new
workbook. I realize the code for my report generating will need to be
modified to refer to the correct pages.

Jim Thomlinson[_3_]

Code to open new workbook, prompt for 'save as' name.
 
To get a new workbook you can use code similar to

dim wbk as workbook

set wbk = workbooks.add

To save this new workbook you can use

wbk.saveas "C:\MyBook.xls"

HTH

"Mark" wrote:

I have created extensive code to derive reports off a current workbook.

What I want to do now is create a macro in my original workbook that will
open a new workbook, run my report code, and then prompt for a save_as name.

The most important part is really just getting a macro to open a new
workbook. I realize the code for my report generating will need to be
modified to refer to the correct pages.



All times are GMT +1. The time now is 06:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com