Ignoring a Macro when "Save as"

I have a Workbook with the following macro. I want to let the user "Save
As" and rename the workbook and not have the macro take place when the
newly named workbook gets re-opened. Anyone have any ideas?


Here is the current macro, nothing fancy just setting some default
values upon opening the workbook:

Private Sub Workbook_Open()
With Sheets("Fab Sheet")
..Range("E15,E18,E22,E26,E30,E37,E43").Value = 1
..Range("A11,B11,A13,B17,C27,C31,B35,B41,B50,B52,C55").Value = 0
..Range("B3..B8").Value = ""
End With
End Sub

The macro is located on the ThisWorkbook area.


---
Message posted from http://www.ExcelForum.com/

0
12/10/2003 8:58:09 PM
excel.misc 78881 articles. 5 followers. Follow

1 Replies
461 Views

Similar Articles

[PageSpeed] 51

While it's not the cleanest way, putting this as the first line of 
your code:

    If Me.Name <> "MyName.xls" Then Exit Sub

In article <Lovelock.David.y8oq0@excelforum-nospam.com>,
 Lovelock, David <Lovelock.David.y8oq0@excelforum-nospam.com> 
 wrote:

> I have a Workbook with the following macro. I want to let the user "Save
> As" and rename the workbook and not have the macro take place when the
> newly named workbook gets re-opened. Anyone have any ideas?
> 
> 
> Here is the current macro, nothing fancy just setting some default
> values upon opening the workbook:
> 
> Private Sub Workbook_Open()
> With Sheets("Fab Sheet")
> .Range("E15,E18,E22,E26,E30,E37,E43").Value = 1
> .Range("A11,B11,A13,B17,C27,C31,B35,B41,B50,B52,C55").Value = 0
> .Range("B3..B8").Value = ""
> End With
> End Sub
> 
> The macro is located on the ThisWorkbook area.
>
0
jemcgimpsey (6723)
12/10/2003 9:28:31 PM
Reply:

Similar Artilces:

Difference between Publish and Save As Web Page in Excel 2002
I am trying to find aout the differences between using the Publish button in Save as Web Page and using Save in there. I have seen that when I use Save, it saves the Named ranges as bookmarks where Publish saves them as cell references. Can you tell me why and if there are any other differences I may need to know Hi, when you publish, the result can be viewed as an excel web page, whereas if you "save as web page", it just makes an xml sheet. Save As only allows one sheet in the workbook whereas publish allows more. - mark >-----Original Message----- >I am trying t...

Save As Web Page Colours
When you save as web page you get a kind of Teal/green/blue colour scheme. Is there any way to set this to a colour scheme of my choice? Thanks Terry And how does this apply to Outlook? "Terry" <Terry@discussions.microsoft.com> wrote in message news:BB2B539E-8C6B-48F8-8470-DF32A6636AA8@microsoft.com... > When you save as web page you get a kind of Teal/green/blue colour scheme. > Is > there any way to set this to a colour scheme of my choice? > Thanks > Terry ...

Cognos Impromptu Save As Excel with Format
I am running Cognos Series 7 Version 3 client and often export data to Excel. When I perform "Save As...", with "Save as type: Excel with Format" I get a file that appears to be an Excel file. (I am using Office 2003 SP3) However, if I then attempt "Save As..." in Excel, the default "Save as type:" is "Single File Web Page (*.mht; *.mhtml)". Not a big problem unless the file is very large which may cause the file to take several minutes to open or not open at all. I would appreciate any suggestions. Did anyone ever answer you? We...

Save As Macro
I have created a macro that I use weekly. The macro names and saves the spreadsheet. Currently, when saving the spreadsheet I am asked "A file name ‘c:\filename.xls’ already exists in this location. Do you want to replace it?" Is there a way that I can amend the macro to automatically answer YES. ActiveWorkbook.SaveAs Filename:="c:\filename.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Thanks Application.displayalerts = false 'your code...

save as pipe delimited #2
hi, just an appendage: i found another link, which provides a file by Earl which does this. http://www.excelforum.com/showthread.php?t=265998&highlight=pipe+delimited i am not able to figure out where to input the filename for the data t be picked up from. any information regarding this would be helpful. thanks, mac -- icestationzbr ----------------------------------------------------------------------- icestationzbra's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=458 View this thread: http://www.excelforum.com/showthread.php?threadid=26877 ...

Save As default.
Is there a way, when doing a save-as of an attachment, to have Outlook default to a folder other than MyDocuments ? I found a KB article but was wondering if it has been fixed. Thanks Dave, This requires a simple registry change. I don't remember the exact key nor the exact white paper regarding this. I did; however, change the default directory for a client and I found out how to do that with a white paper at www.microsoft.com/technet - Marty "Dave McDuell" <dmcduell@earthlink.net> wrote in message news:071301c3b2d0$1579ee80$a101280a@phx.gbl... > Is there a wa...

Save As?...
I'm using Outlook 2003 with BCM. When I get an html email (I'm assuming that's what they are called if they have graphics and look more like a web page than a text email), and want to save it, I've been just clicking... File > Save As > (select file type) *.html > (specify filename) Unlike in IE6, there's no option to save it as a single file archive such as type *.mht. Are the *.html files I've been saving in OUTLOOK "permanent" (or flat, or whatever you would call them) so that even if the original web site is taken down, my *.html file wil...

how do i save as a .doc document?
how do I save my file as a .doc? al <al@discussions.microsoft.com> was very recently heard to utter: > how do I save my file as a .doc? Depending on your version of Publisher, there's an option under File > Save As..., but I doubt that's what you really want to do, as it destroys your layout and formatting. Can you tell us why you want to save as a .doc? Perhaps then we can suggest an alternative solution. -- Ed Bennett - MVP Microsoft Publisher ...

Save as msg file with proper file (date) attributes
Hi there, I would like to save outlook mail items as msg files. If I do so using drag & drop to the explorer the date&time attributes of the created msg file will have the value of the current date & time (creation date&time of the file). I would like to have them set with the values from within the mail item. ==> Date sent or received. How can this be accomplished? Are there any tools wich can alter the file atrributes in this way automatically? Thank you for your help Lex ...

Mac save as format for Windows
I am running OS10.2.8 with Office X on a Mac. Which "save as" format do I use to save an Excel spreadsheet so that it can be opened on a Windows computer without losing any of the information or formatting? --- Message posted from http://www.ExcelForum.com/ Save As Excel Workbook. Win Office 97/00/02/03 and Mac Office 98/01/v.X all share exactly the same file format. While it isn't really necessary, some Windows users will be helped if you make sure to include a file extension (".xls") at the end of your filename. In article <balcom.zue8s@excelforum-nospam...

Save As CSV saves empty rows
I have an XLS worksheet that copies cells from a different worksheet in the same workbook using the following function "=T(UPPER(<other worksheet name>!<other worksheet cell>)). The formula is copied throughout the worksheet using relative cell reference. When I save the worksheet as a csv file all of the records that have no data are also saved. What I end up with in the csv file looks something like this: data,data,data,data, ,,,, How do I tell Excel to not save the empty rows? But those aren't empty cells to excel. They contain formulas that evaluate to ""...

Mass VCard Export/Save As
How can I save multiple selected contacts as VCards? I see I can do this individually, but not en masse. My goal is to transfer my contacts to my IPod, but I can't find any freeware solutions for this. Chris google suggests : http://outport.sourceforge.net/ "Chris" <AccessCaz@pobox.com> wrote in message news:%23rA4$igzDHA.1100@TK2MSFTNGP10.phx.gbl... > How can I save multiple selected contacts as VCards? I see I can do this > individually, but not en masse. My goal is to transfer my contacts to my > IPod, but I can't find any freeware solutions for this...

diasable "save as"
I setup a vb that disables the save as on the file menu. the code works as expected. But only if I click on run in the VB editor. In general I have sub command saveas enable=false (not exact syntax ) end sub How do I get this to execute when I open the workbook? When I close the workbook I want to reverse the code so that the next workbookthat is opened does not have saveas greyed. I have the code, but where to put it, so that it executes, is my problem. >I setup a vb that disables the save as on the file menu. > the code works as expected. But only if I click on run in the VB edit...

Missing "Save" and "Save As" functions
When I try to save a spreadsheet, I only have the option to save it as a Workspace. The "Save" and "Save As" options aren't in the "File" menu at all. Can anyone help? Hi does this happen with all files or only with a specific one? -- Regards Frank Kabel Frankfurt, Germany EMSchon wrote: > When I try to save a spreadsheet, I only have the option to save it > as a Workspace. The "Save" and "Save As" options aren't in the > "File" menu at all. Can anyone help? It happened to all of them and is now resolv...

How to make a .XLTM template file default to save as .XLSM type?
I have a Excel 2007 macro-enabled template (.XLTM) which I use regularly. Whenever I open this template then use save or save as to create a new file the default workbook type of .XLSX is selected instead of .XLSM. How can I change the default behaviour for this template to automatically select a .XLSM format in the "Save As" dialog wihtout changing it for every document as happens by using the 'Excel Options>>Save>>Save Files in this Format' drop down box. Cheers Perhaps some code in ThisWorkbook module of the Template; Private Sub Workbook_B...

Macro: Setting a dynamic range for Save as Web Page
Excel 2000. After creating a new worksheet with a macro, I want to save the contents as an HTML page. I'm new to VB, so I've been using the macro recorder, then tweaking the output. Here's the problem. I'm trying to save just a range of cells, from A1 to the xlCellTypeLastCell, containing data pasted in by the macro. If I just record what I'm doing manually, ActiveWorkbook.PublishObjects.Add uses an absolute range, like $A$1:$J$1253. The $A$1 is OK, but the second value will vary from time to time as the dimension of the pasted data changes. So I tried jamming ...

Save as web page
Is there a way to use the "Save as web page" menu function, to save a calendar as a web page, on a periodic basis. I would like to publish my calendar to a web page, but I don't want to have to keep doing it manually. I don't want to use the publish option (at least I don't think I do), because then you need to use outlook to view the information. ...

Save As Dialog Box defaulting as Thumbnail View.
I have noticed when I right click on a file to "save As" the dialog always defaults to Thumbnail View and so I have to click on the views tab to change it to Detail Tab is there a way in folder options or control panel to change the setting to make the dialog box default to detail view ? Some feedback on this would be appreciated. -- James M. Horak P.O. Box 2167 Belton Texas, 76513 "jhorak101" <james.horak@yahoo.com> wrote in message news:CF5F2708-8E9E-445D-9F8C-08F17FECB551@microsoft.com... >I have noticed when I right click on a file to "s...

save as html
when i save a file as html it can not be filled in is there a way to save it as html and also be able to fill it in? ...

Charts move down page when save as PDF
I have a user that has stored 5 pages of Excel charts on one worksheet. When she save as a PDF form the charts seem to move down the page and masking over text. Is there something we can do to prevent this? ...

Save as .doc
In Outlook 2003 there is no option to save an eemail as .doc. is there setting that can be turned on to allow this? REBeyer wrote: > In Outlook 2003 there is no option to save an eemail as .doc. > is there setting that can be turned on to allow this? Not that I know of. You can save as .txt, open in Word, and save as a Word doc, though. "Lanwench [MVP - Exchange]" wrote: > REBeyer wrote: > > In Outlook 2003 there is no option to save an eemail as .doc. > > is there setting that can be turned on to allow this? > > Not that I know of. You can save as ...

Save as...
Hi. When I am doing a save as from my outlook it defaults to C:\somewhere Is this defaultsetting able to change? //Mariah MN wrote: > Hi. > > When I am doing a save as from my outlook it defaults to C:\somewhere > > Is this defaultsetting able to change? > > //Mariah See http://www.swinc.com/odefpath/ for one option. Mariah, Changing the default location for Outlook seems to be a registry change. Please see link below. Hope this helps. Regards, Francine http://office.microsoft.com/en-us/assistance/HA011265401033.aspx -- Francine Otterson President, San Di...

Save as type
I have installed Outlook 2003. When there is an inbedded picture to save the picture the only type available is bmp. How can I add jpg, gif, etc. to the down drop options? You can create a macro for this (adjust the SaveAsFile location if desired); Sub SaveAttachment() Dim objCurrentItem As Outlook.MailItem Dim colAttachments As Outlook.Attachments Dim objAttachment As Outlook.Attachment Set objCurrentItem = Application.ActiveInspector.CurrentItem Set colAttachments = objCurrentItem.Attachments For Each objAttachment In colAttachments objAttachment.SaveAsFile ("C:...

Save as in Outlook
Hi. Is there any way to change the behaviour when I am trying to save a mail or attachment in a folder in the filesystem, with the question that you can see in explorer when copying/moving a file to a folder that already exists in the target folder. I get the Confirm replacement of file dialogbox and a text that tells me that this folder already consists of a file with name test.doc and the question if I want to replace the file with the size and changedate with a file with another size and changedate. Mariah MN wrote: > Hi. > > Is there any way to change the behaviour when I am...

save as,
hi, is there any way that i can save a copy of my document, in vba cod under a new name, and not change my open document to the new name /jock -- Message posted from http://www.ExcelForum.com Hi Jocke Have a look at the SaveCopyAs-method. -- Best Regards Leo Heuser Followup to newsgroup only please. "jocke >" <<jocke.155t56@excelforum-nospam.com> skrev i en meddelelse news:jocke.155t56@excelforum-nospam.com... > hi, is there any way that i can save a copy of my document, in vba code > under a new name, and not change my open document to the new name > &g...