ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using a workbook name (https://www.excelbanter.com/excel-programming/398019-using-workbook-name.html)

Chris Rees

Using a workbook name
 
Is there anyway to use a workbook name in code without using
application.getsaveasfilename or getopenfilename? As I am trying to create
multiple workbooks from a master workbook and would prefer not to have to
save the workbook every time.

Bob Phillips

Using a workbook name
 
The workbook doesn't get a full name until it is saved.

You could always create a workbook object when you save it

Set oWB = Workbooks.Add

and use that object after that.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Chris Rees" wrote in message
...
Is there anyway to use a workbook name in code without using
application.getsaveasfilename or getopenfilename? As I am trying to create
multiple workbooks from a master workbook and would prefer not to have to
save the workbook every time.




JW[_2_]

Using a workbook name
 
Just set the workbook name or workbook itself to a variable and use it
however you want.
Dim wbName As String
wbName=ActiveWorkbook.Name
or
Dim wb As Workbook
Set wb = AvtiveWorkbook
Chris Rees wrote:
Is there anyway to use a workbook name in code without using
application.getsaveasfilename or getopenfilename? As I am trying to create
multiple workbooks from a master workbook and would prefer not to have to
save the workbook every time.




All times are GMT +1. The time now is 02:13 PM.

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