Excel VBA works for 1 user, but not another

shouyeah

New Member
Joined
Feb 26, 2009
Messages
8
I have a Excel file using VBA that I am able to run all macros just fine. Another user was able to run the file just fine last month and the month before, but for some reason, she is unable to run the macro this month. When running the macros, she gets the Run Time error 1004, application or object defined error. She sent me the copy of the file she was using and I was able to run the macros with no issues. When she clicks "debug", it highlights

Code:
Selection.QueryTable.Refresh BackgroundQuery:=False

Any ideas as to why she is all of a sudden unable to run the macros when she was able to do it before?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Could be an issue with the version difference. Did she upgrade or downgrade her version of excel in recent past?
 
Upvote 0
Is the same cell(s) selected when both of you run it?
What is the query-table querying? Is it available to her? Test by refreshing maually.
 
Upvote 0
has she enabled Analysis toolpak VBA in the tools Add-Ins menu
 
Upvote 0
Thanks for the ideas...however:
  1. prabby25101981: There is a version difference. I created the file using Excel 2002 and she has Excel 2003. However, she had Excel 2003 last month when she ran the file and it worked fine, so I'm inclined to think the version is not the issue since it worked before.
  2. p45cal: The same cell is selected. It is in the VBA to select cell A1 first before running the query.
    • I also had her right click on cell A1 and then click "Refresh Data", however nothing happened.
    • When I manually right click on A1 and click "Refresh Data", the data refreshes.
    • The query uses a "generic/shared" Data source and User Name, so nothing is tied to her or my individual user name.
  3. Paul-H: The Analysis Toolpak and Analysis Toolpak VBA items were already "checked".
Any additional ideas would be greatly appreciated.
 
Upvote 0
p45cal: The same cell is selected. It is in the VBA to select cell A1 first before running the query.
  • I also had her right click on cell A1 and then click "Refresh Data", however nothing happened.
  • When I manually right click on A1 and click "Refresh Data", the data refreshes.
So you can manually refresh, she can't. Then it's not likely to be vba the problem, more the querytable can't refresh because perhaps the source data isn't available to it, or the querytable itself has been corrupted or lost altogether. Time for some detective work.
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,762
Members
449,048
Latest member
excelknuckles

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