Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Renaming an open workbook
I have an application that generates some data and launches a workbook named
setup.xls and places the data on the sheet for the user to have a report. Once this has been done, I would like to rename the filled workbook with the name of of one the cell values, for example lets say that the value of "H5" is "333-2323A" I would like to rename the open work book as 333-2323A.xls I am trying to prevent the original copy of setup.xls from being over written everytime it gets ran. One other variation to this would be to have the vba and protection removed for the renamed open book since at this point it is just a data report and the vba is no longer needed. If anyone has any suggestions I am open... Thanks, Jeff W. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Renaming an open workbook
You simply save the workbook as another file anme:
Workbook.SaveAs "333-2323A.xls" "Jeff W." wrote in message ... I have an application that generates some data and launches a workbook named setup.xls and places the data on the sheet for the user to have a report. Once this has been done, I would like to rename the filled workbook with the name of of one the cell values, for example lets say that the value of "H5" is "333-2323A" I would like to rename the open work book as 333-2323A.xls I am trying to prevent the original copy of setup.xls from being over written everytime it gets ran. One other variation to this would be to have the vba and protection removed for the renamed open book since at this point it is just a data report and the vba is no longer needed. If anyone has any suggestions I am open... Thanks, Jeff W. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Renaming an open workbook
Thank you for the responce, but
I guess I didnt do a good job of explaining. I have another application open a work book named setup.xls then it runs through it macros and the last thing that needs to be done is it looks in the H5 cell and re names the open file with that "value".xls I dont want to save it cause we dont know where the user will want to put it until they exit, we just need to re name the open book So when they do exit it wont over write the setup.xls book If I could get it to "rename" my work book and remove all the macros that would be great, cause after the rename and ultimatly the save the user does it becomes a simple datafile... Thanks Jeff W. "Norman Yuan" wrote in message ... You simply save the workbook as another file anme: Workbook.SaveAs "333-2323A.xls" "Jeff W." wrote in message ... I have an application that generates some data and launches a workbook named setup.xls and places the data on the sheet for the user to have a report. Once this has been done, I would like to rename the filled workbook with the name of of one the cell values, for example lets say that the value of "H5" is "333-2323A" I would like to rename the open work book as 333-2323A.xls I am trying to prevent the original copy of setup.xls from being over written everytime it gets ran. One other variation to this would be to have the vba and protection removed for the renamed open book since at this point it is just a data report and the vba is no longer needed. If anyone has any suggestions I am open... Thanks, Jeff W. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Renaming an open workbook
You are going about this from the wrong end.
Save setup.xls as a Template and it can't be overwritten. FileSave AsFile TypeTemplate(*.xlt) Then instruct your users to click on that Template. A new workbook will open based upon the setup.xlt template. Users will fill in and manipulate data then save as any name they wish and to where they want without affecting the original. To get rid of the macros in the new workbook see Chip Pearson's site for removing modules. http://www.cpearson.com/excel/vbe.aspx Gord Dibben MS Excel MVP On Sun, 14 Oct 2007 13:05:55 -0500, "Jeff W." wrote: So when they do exit it wont over write the setup.xls book If I could get it to "rename" my work book and remove all the macros that would be great, cause after the rename and ultimatly the save the user does it becomes a simple datafile... |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Renaming an open workbook
When I do this, then I open that temple manually and try try to run the
macros that do all the work for them, it errors out with runtime error 76 path not found It will run as a xls but not as a xlt with out error I checked all my vba and there arent any references to ".xls" or even the file name "setup" so I'm not sure where this path error is coming from <Jeff "Gord Dibben" <gorddibbATshawDOTca wrote in message ... You are going about this from the wrong end. Save setup.xls as a Template and it can't be overwritten. FileSave AsFile TypeTemplate(*.xlt) Then instruct your users to click on that Template. A new workbook will open based upon the setup.xlt template. Users will fill in and manipulate data then save as any name they wish and to where they want without affecting the original. To get rid of the macros in the new workbook see Chip Pearson's site for removing modules. http://www.cpearson.com/excel/vbe.aspx Gord Dibben MS Excel MVP On Sun, 14 Oct 2007 13:05:55 -0500, "Jeff W." wrote: So when they do exit it wont over write the setup.xls book If I could get it to "rename" my work book and remove all the macros that would be great, cause after the rename and ultimatly the save the user does it becomes a simple datafile... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
renaming a workbook | Excel Programming | |||
Renaming a workbook without saving | Excel Programming | |||
Workbook renaming | Excel Programming | |||
Workbook renaming! | Excel Programming | |||
Renaming workbook! | Excel Programming |