Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add code to ThisWorkbook module
From an end of day macro, a sub performs a Save-As to creates a new
file name for the same data. Can I add code to the new file ThisWorkbook module that will also perform a Save-As to create a third file? Ex: Macro in file First.xls performs Save-As to create file Second.xls. The same macro will add code in ThisWorkbook module of Second.xls that will perform Save-As to create file named Third.xls. Is this possible? I'm trying to do a work around that will free up the file Second.xls when users open it up. This, so an end of day macro can update Second.xls even if opens up that file before the report is run. Hope this makes sense. Thanks j.o. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add code to ThisWorkbook module
Hi ExcelNut,
See |Chip Pearson at:: Programming The VBA Editor http://www.cpearson.com/excel/vbe.aspx --- Regards. Norman "excelnut1954" wrote in message ... From an end of day macro, a sub performs a Save-As to creates a new file name for the same data. Can I add code to the new file ThisWorkbook module that will also perform a Save-As to create a third file? Ex: Macro in file First.xls performs Save-As to create file Second.xls. The same macro will add code in ThisWorkbook module of Second.xls that will perform Save-As to create file named Third.xls. Is this possible? I'm trying to do a work around that will free up the file Second.xls when users open it up. This, so an end of day macro can update Second.xls even if opens up that file before the report is run. Hope this makes sense. Thanks j.o. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add code to ThisWorkbook module
On Jun 2, 12:01*pm, "Norman Jones"
wrote: Hi ExcelNut, See |Chip Pearson at:: * * * * Programming The VBA Editor * * * *http://www.cpearson.com/excel/vbe.aspx --- Regards. Norman "excelnut1954" wrote in message ... From an end of day macro, a sub performs a Save-As to creates a new file name for the same data. Can I add code to the new file ThisWorkbook module that will also perform a Save-As to create a third file? Ex: Macro in file First.xls performs Save-As to create file Second.xls. The same macro will add code in ThisWorkbook module of Second.xls that will perform Save-As to create file named Third.xls. Is this possible? I'm trying to do a work around that will free up the file Second.xls when users open it up. This, so an end of day macro can update Second.xls even if opens up that file before the report is run. Hope this makes sense. Thanks j.o.- Hide quoted text - - Show quoted text - Thanks, Norman. I appreciate your reply. I went in Chip's site, and I think I found what I needed. But, it looks like there are a few Excel settings that would need to be changed in all the computers that would access this file. That's impossible here. The settings on many programs in all the computers here are all restored to default mode. Even Excel is restored to default mode each night in all the computers. Really sucks. But, I found an old post that I adapted to help in a work around. It's an If-then for the ThisWorkbook module. Very simple. Sub fndFileNm() fname = ActiveWorkbook.Name Application.DisplayAlerts = False If fname = "Current Furniture Staging List - testing.xls" Then ActiveWorkbook.SaveAs _ Filename:="\\ceddfssrv01\cedroot\public\furniture staging list" & "\Current Furniture Staging List - MacroTest.xls" Application.DisplayAlerts = True End If End Sub I tested it, and it seems to work. I'll try it in the live version of the file tomorrow. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use module, not thisworkbook | Excel Programming | |||
Can I add code to ThisWorkbook module with VBA extensibility? | Excel Programming | |||
Calls from sheet module to ThisWorkbook module | Excel Programming | |||
Empty ThisWorkbook module, but Macro warning problem | Excel Programming |