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?
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

prabby25101981

Active Member
Joined
Jul 28, 2010
Messages
348
Could be an issue with the version difference. Did she upgrade or downgrade her version of excel in recent past?
 

p45cal

Well-known Member
Joined
Nov 10, 2009
Messages
4,763
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.
 

Taul

Well-known Member
Joined
Oct 24, 2004
Messages
667
Office Version
2019, 2013, 2010
Platform
Windows
has she enabled Analysis toolpak VBA in the tools Add-Ins menu
 

shouyeah

New Member
Joined
Feb 26, 2009
Messages
8
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.
 

p45cal

Well-known Member
Joined
Nov 10, 2009
Messages
4,763
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.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,105,998
Messages
5,508,681
Members
408,690
Latest member
Lip Renan

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top