Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use module, not thisworkbook okrob Excel Programming 6 January 19th 07 02:08 AM
Can I add code to ThisWorkbook module with VBA extensibility? mikeb Excel Programming 3 May 9th 06 11:35 PM
Calls from sheet module to ThisWorkbook module quartz[_2_] Excel Programming 2 June 23rd 05 03:37 PM
Empty ThisWorkbook module, but Macro warning problem Stuart[_5_] Excel Programming 3 June 28th 04 07:20 PM


All times are GMT +1. The time now is 09:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"