Solved

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

Posted on 2015-01-14
3
126 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:Michael74
Michael74 earned 100 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 400 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 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