?
Solved

I get an error when I open my spreadsheet that has a query

Posted on 2015-01-14
3
Medium Priority
?
153 Views
Last Modified: 2015-01-16
I have a spreadsheet with an ODBC query. When I open the spreadsheet, I get a "Run-time error '1004': Method 'Range' of object'_Global' failed" message. I attached a screenshot. When I click on Debug, it takes me to visual basics. How do I resolve this? Thanks!
Run-Time-Error-1004.png
0
Comment
Question by:brasiman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 23

Assisted Solution

by:Michael Fowler
Michael Fowler earned 400 total points
ID: 40550067
Is the named range "Path" defined? If not it would explain the error. Quick check change Range("Path") to point to an empty cell as a test eg Range("A1").value
0
 
LVL 12

Accepted Solution

by:
James Elliott earned 1600 total points
ID: 40551247
That cods is being triggered whenever the workbook is opened. It doesn't appear to have anything to do with your ODBC query. It looks like it's trying to capture whether the file location has changed since the file was last opened.
0
 

Author Closing Comment

by:brasiman
ID: 40553800
Thanks guys. Michael74 I tried your suggestion, and that pointed me in a direction. James, you are right, it was actually for a different query. I used this query for something else and modified it to be the new query. I just didn't delete all the old macros. Thanks for both your help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question