Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Let me begin by saying I'm not a programmer (any more), I'm a Spanish
interpreter at a Court. I have done all of the following using the "macro record" and "customize toolbar" features from the Excel menus - I do not do any VB programming. I have created an Excel 2003 spreadsheet, running in Windows XP, that contains a simple macro, stored in the workbook itself, to do some find and replace commands. Let's call the worksheet "Master_file.xls". Let's call the macro "My_macro" The macro is in the spreadsheet. I created a custom toolbar (let's call it "smiley_face"), attached to this spreadsheet, and assigned the macro to the toolbar. The name of the assigned macro appears as My_macro. It does not indicate any excel file name. I made the spreadsheet read-only - I want to be sure my end-users at other Courts cant mess it up. Heres the problem: My users paste data into the spreadsheet, press the smiley face button, (which runs My_macro) and then "save as". It's read-only so they rename it as "Saved_File". The next time my user opens "Master_File", pastes data, and then presses the "smiley face" button to run the macro, Excel opens "Saved_File" to get the macro. The name of the macro assigned to the toolbar now says 'Saved_File'!My_macro When the user tries to do a save as "Saved_File", excel says it can't save, since that file is already open (since it opened it to get the macro). They have to close €śSaved_File€ť first, then "save as" again, and they are confused about what happened. Sometimes they wind up not saving anything. Im perplexed about why the macro address pointer assigned to the toolbar changes to the file name last saved. I tried hard-coding the name into the original worksheet, but that doesnt seem to make any difference. I would like the macro to always run from €śMaster_File€ť, rather than from the file last saved. Can I do this without coding, or by just editing the existing macro code in the VB editor? Or what are my options? Heres the macro code: Sub Replace_Chars() ' ' Replace_Chars Macro ' Macro recorded 8/31/2007 by Maintenance ' Cells.Replace What:="@", Replacement:="", LookAt:=xlPart, SearchOrder:= _ xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False Cells.Replace What:="~*F-", Replacement:="", LookAt:=xlPart, SearchOrder _ :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False End Sub Thanks a lot! Activoz_Interpreting |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
In Excel 2003 is there a way to prevent "Save As" and "Print"? | Excel Discussion (Misc queries) | |||
"Save" and "Save As" options greyed out - "Save as Webpage" option | Excel Discussion (Misc queries) | |||
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" | Excel Discussion (Misc queries) | |||
Running a macro "On Save" | Excel Discussion (Misc queries) | |||
Macro to create "path" for save | Excel Discussion (Misc queries) |