Solved

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

Posted on 2015-01-14
3
113 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
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now