Simple query opens an unexpected workbook?

Dougmeister

New Member
Joined
Sep 23, 2010
Messages
42
A simple 3-line macro I made. I assigned a hotkey to it and put it on the ribbon (Excel 2013).

When I run it (via hotkey or icon on the ribbon), it opens an older version of the workbook in another folder on my hard drive.

How do I find out why it is doing this? I've searched for the filename, for "C:", etc, but am finding nothing. When I single step through the macro, it works as intended without opening the auxiliary file.

ActiveCell.Value = "xxxx"
Selection.Font.Color = -4165632
Selection.Rows.AutoFit

At the bottom of the Excel window, I can see a message saying "Linking... <filename>" before it opens a similarly (but not exactly) named file...

... help?</filename>
 
Last edited:

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Have you looked in the ThisWorkbook and Sheet modules in your workbook, see if any code assigns a hotkey or triggers an event?
 
Upvote 0
Just checked and, no, nothing at all in ThisWorkbook, and nothing in the Sheet modules that would assign a hotkey or trigger an event.
 
Upvote 0
Have you any linked workbooks, e.g. a formula, named range or data connection which comes from elsewhere?
 
Upvote 0
Have you tried deleting and recreating the ribbon item? It sounds like it's assigned the wrong macro.
 
Upvote 0
It eventually runs the correct macro (the 3 lines of code in the original post), but it opens the other workbook first... (?) Weird...
 
Upvote 0
That totally fixed it! Thanks.

Bonus points: can you help me understand *why* this happened, why deleting it from the ribbon and recreating the icon fixed it, etc.?
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top