Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 557
Default MACRO TO POP UP SAVE AS WINDOW

Hi all, I have excel 2007 file which is read only so no one can make
changes when using it. I have put a little note in every sheet of
that file which says that "save the file after making changes by going
on Save As and select Excel Macro-Enabled Workbook format" but lots
of users forget it sometime. So I want macro that when someone open
that file then "Save As" window should appear and in "File name" box
the text should show that "enter your file name" and in "Save as type"
box it should be appearing "Excel Macro-Enabled Workbook" and also it
should save the file in "Document" folder on "C" drive. But the main
thing is that one that macro should work when someone open the file or
Workbook and two that this macro should not be transfered to the "Save
As" file as I dont want macro to bring up "Save As" window when
someone open the Save As file. I only want this macro in the read
only file. For example if my read only file name is "XX" and someone
open this file the "Save As" window should appear and after when user
save the file and give name to that file lets say "ZZ" and now when
user open the file "ZZ" again i dont want macro to bring up "Save As"
window, in other words that Save As macro should be only work in
original read only or "XX" file but once its been Save as to different
place then macro should be deleted in those file or should not work.
I hope I was able to explain my question. Please can any friend can
help as this macro will save lots of time and will make things easy.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default MACRO TO POP UP SAVE AS WINDOW

K,

Put this into the codemodule of the ThisWorkbook object: of course, change the XX to the actual
name...

Private Sub Workbook_Open()
If ThisWorkbook.Name < "XX.xlsm" Then Exit Sub
ChDir "C:\Document"
ThisWorkbook.SaveAs Application.GetSaveAsFilename _
("New file name.xlsm", "Macro-enabled workbook files (*.xlsm), *.xlsm)", _
, "Enter Save As File Name"), 52
End Sub

HTH,
Bernie
MS Excel MVP


"K" wrote in message
...
Hi all, I have excel 2007 file which is read only so no one can make
changes when using it. I have put a little note in every sheet of
that file which says that "save the file after making changes by going
on Save As and select Excel Macro-Enabled Workbook format" but lots
of users forget it sometime. So I want macro that when someone open
that file then "Save As" window should appear and in "File name" box
the text should show that "enter your file name" and in "Save as type"
box it should be appearing "Excel Macro-Enabled Workbook" and also it
should save the file in "Document" folder on "C" drive. But the main
thing is that one that macro should work when someone open the file or
Workbook and two that this macro should not be transfered to the "Save
As" file as I dont want macro to bring up "Save As" window when
someone open the Save As file. I only want this macro in the read
only file. For example if my read only file name is "XX" and someone
open this file the "Save As" window should appear and after when user
save the file and give name to that file lets say "ZZ" and now when
user open the file "ZZ" again i dont want macro to bring up "Save As"
window, in other words that Save As macro should be only work in
original read only or "XX" file but once its been Save as to different
place then macro should be deleted in those file or should not work.
I hope I was able to explain my question. Please can any friend can
help as this macro will save lots of time and will make things easy.



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
'Save as' window in VBA cluckers Excel Discussion (Misc queries) 1 October 29th 09 04:10 PM
how to save a desired window size but hv window comeup fullsz by d smjm1982 Excel Discussion (Misc queries) 1 February 15th 08 11:10 AM
Run Macro If Save Is Canceled On SaveAs Window In VBA Celtic_Avenger[_42_] Excel Programming 0 September 19th 04 09:30 AM
Run Macro If Save Is Canceled On SaveAs Window In VBA Celtic_Avenger[_41_] Excel Programming 2 September 19th 04 02:34 AM
How to call File Open / Save Window in a Macro [email protected] Excel Programming 1 January 28th 04 03:46 PM


All times are GMT +1. The time now is 08:54 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"