?
Solved

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

Posted on 2015-01-14
3
Medium Priority
?
147 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

Independent Software Vendors: 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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
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…

771 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