File opens second copy of itself for no apparent reason

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Using Office 2003 and Windows Xp;

I have a file with a small cell clearing macro as the only program in the
whole file. The file is a regular XLS and there is no code in any sheet
module nor in the ThisWorkbook module.

Here is the strange part. When I open this workbook, it also opens a
template of itself even though there is nothing telling it to do this. Also,
the template of the XLS is an older version of the original...

I have checked the references in the VBE under Tools then References and
there are no references to external files. I have looked in the folder where
the file resides and no other files exist with this name. Even if I close all
the way out of the application, the next time I open this file, another older
copy is opened along side.

Can anyone tell me what the h*** is going on? And, how to fix this?

Thanks much in advance.
 
I would recommend setting your security level to medium. and comment out the
macro in the spreadsheet. Then close and open the worksheet and see if the
message to enable macros comes up. This will tell you for sure if there are
really no macros in the worksheet.
 
My macro security is already set to medium; I tried disabling macros and it
still does it;

Also, I think just the presence of a module will invoke macro security;
however, I did comment out the code and that did seem to stop the issue...

Here is the code in its entirety - still in draft and never run or tested
(nor is there any other file open):

Public Function ClearForm(argFileName As String)
'clear entire form
Workbooks(argFileName).Activate
Sheets(gcsSheetCRF).Activate
Sheets(gcsSheetCRF).Range("D6:E7").ClearContents
Sheets(gcsSheetCRF).Range("C8:E10").ClearContents
Sheets(gcsSheetCRF).Range("H6:I10").ClearContents
Sheets(gcsSheetCRF).Range("C13:I57").ClearContents
Sheets(gcsSheetCRF).Range("F61:I61").ClearContents
End Function

Really strange!
 
You are right. You would have tto remove the module. IN VBAProject window
right click module1 (or what ever) and remove. Then try closing and openning
the wrokbook.
 
Perhaps you saved the file with 2 separate windows open (Window >> New
window) ?

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top