Why is VBA macro opening the file it was copied from, not the sheet in the current workbook?
<p>I copied all macros from Module 1 in one file to Module 1 another, including this one:</p>

<pre><code>Sub OpenMonth4tabs()
 '
' OpenMonth4tabs Macro
' Closes all sheets except Base Values
' Opens sheets for Month 4, prepares Base Data for month 4 view
'
 Call HideAllSheets
 Call PrepareMonth4Base

Sheets("M4 Sales Record").Visible = True
Sheets("M4 Sales Record").Select
Sheets("M4 P&amp;L").Visible = True
Sheets("M4 P&amp;L").Select
Sheets("M4 Sales KPIs").Visible = True
Sheets("M4 Sales KPIs").Select
Sheets("M4 Aftersales KPIs").Visible = True
Sheets("M4 Checklist").Visible = True
Sheets("M4 Checklist").Select
Range("C10").Select

End Sub
</code></pre>

<p>However, although the file I am working in has tabs with the exact names as the original (it is a later version with a similar name), when it runs it opens the original file and tabs, not the tabs in the current workbook. I can't see anything in the code that identifies the original workbook, and don't know how to prevent this.</p>

<p>What is the reason the code is referring to another, closed workbook?
How can I get it to work within the new workbook, and not open the old one?
Any help will be greatly appreciated, it is driving me nuts!</p>