#1   Report Post  
andy
 
Posts: n/a
Default Checking FileName

I want to have a macro that is utilised when my workbook is opened. What I
need it to do is, look at the current filename, if it is still the same as
the template filename, then bring up a message box that will have the option
of going to the save as.. function, or clicking cancel will just open the
book as normal.

If however, the name has changed from the original title, then it will just
load up without having a message box.

Any help will be greatly appreciated.
  #2   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Andy,

If you're really using an Excel template (saved as a template -- xlt file
extension), you won't need to do any of this. You create a new workbook
based on the template (File - New - from template -- varies with your
version of Excel), do your work, then save that workbook. The template
won't be overlaid unless the user uses File - Save as, and specifies
template. You can mark it read-only to help prevent that.
--
Earl Kiosterud
www.smokeylake.com

"andy" wrote in message
...
I want to have a macro that is utilised when my workbook is opened. What I
need it to do is, look at the current filename, if it is still the same as
the template filename, then bring up a message box that will have the
option
of going to the save as.. function, or clicking cancel will just open the
book as normal.

If however, the name has changed from the original title, then it will
just
load up without having a message box.

Any help will be greatly appreciated.



  #3   Report Post  
andy
 
Posts: n/a
Default

It is a template that I made myself for others to use (it isn't one of the
pre-made excel templates), which they open, use the save as.. function to
save it as the correct w/ending date. The only problem is the people using it
aren't really paying attention and changing parts of the template, and then
saving over the template. I want to do it this way to make sure that they
have to use the save as.. function and don't edit the original.

"Earl Kiosterud" wrote:

Andy,

If you're really using an Excel template (saved as a template -- xlt file
extension), you won't need to do any of this. You create a new workbook
based on the template (File - New - from template -- varies with your
version of Excel), do your work, then save that workbook. The template
won't be overlaid unless the user uses File - Save as, and specifies
template. You can mark it read-only to help prevent that.
--
Earl Kiosterud
www.smokeylake.com

"andy" wrote in message
...
I want to have a macro that is utilised when my workbook is opened. What I
need it to do is, look at the current filename, if it is still the same as
the template filename, then bring up a message box that will have the
option
of going to the save as.. function, or clicking cancel will just open the
book as normal.

If however, the name has changed from the original title, then it will
just
load up without having a message box.

Any help will be greatly appreciated.




  #4   Report Post  
Earl Kiosterud
 
Posts: n/a
Default

Andy,

I'm still not sure we're talking about the same things. Does this
"template" have the extension .xls? Or is it .xlt? Do you open it as a
regular .xls file. Or do you open it changing the requested file type to
..xlt?
"andy" wrote in message
...
It is a template that I made myself for others to use (it isn't one of the
pre-made excel templates), which they open, use the save as.. function to
save it as the correct w/ending date. The only problem is the people using
it
aren't really paying attention and changing parts of the template, and
then
saving over the template. I want to do it this way to make sure that they
have to use the save as.. function and don't edit the original.

"Earl Kiosterud" wrote:

Andy,

If you're really using an Excel template (saved as a template -- xlt file
extension), you won't need to do any of this. You create a new workbook
based on the template (File - New - from template -- varies with your
version of Excel), do your work, then save that workbook. The template
won't be overlaid unless the user uses File - Save as, and specifies
template. You can mark it read-only to help prevent that.
--
Earl Kiosterud
www.smokeylake.com

"andy" wrote in message
...
I want to have a macro that is utilised when my workbook is opened. What
I
need it to do is, look at the current filename, if it is still the same
as
the template filename, then bring up a message box that will have the
option
of going to the save as.. function, or clicking cancel will just open
the
book as normal.

If however, the name has changed from the original title, then it will
just
load up without having a message box.

Any help will be greatly appreciated.






  #5   Report Post  
andy
 
Posts: n/a
Default

Don't worry about the whole template part, it has nothing to do with it, I
just need help with the visual basic side of it, as asked for in my original
post. It basically needs to:

1. Look at workbook filename.
2. If it is equal to a certain filename, then bring up a message box.
3. Have one button link to the Save As.. function.
4. Have one button to just cancel, and enter the workbook.
5. If the workbook has a different name, then have it just open the workbook
without the messagebox.


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
Concatinate a filename CLR Excel Discussion (Misc queries) 28 August 1st 05 11:45 PM
filename pointer tanhs Excel Worksheet Functions 0 June 21st 05 02:09 AM
Filename at the very top of Microsoft Excel Window Skyking Excel Discussion (Misc queries) 2 April 28th 05 04:25 AM
2 Question: Coloumn width, Filename nopfusch Excel Worksheet Functions 2 March 15th 05 07:43 PM
Insert value of a cell as a filename Ralph Howarth Excel Worksheet Functions 0 January 18th 05 12:03 AM


All times are GMT +1. The time now is 05:56 AM.

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"