Solved

Excel Macro recorder keeps including Activeworkbook.sheet (xxxxx).  How do I prevent that?

Posted on 2013-05-26
5
202 Views
Last Modified: 2014-05-23
Hi Folks,

I have an excel 2010 user who's not adept at modifying the macro VBA code.  This person uses the macro recorder to create fairly simple macros in the 5 to 15 step range.

The issue is that, when she records the macro (to the personal.xlsb), it is including the name of the workbook and sheet name that she was using when she created / recorded the macro.

So, when she goes to apply this macro to another spreadsheet workbook (entirely different file), it fails because the workbook / sheet names are different.

This does not happen with another user.  So, the question is, short of editing the VBA generated by the macro recorder, how do I prevent the macro recorder from including the active workbook / sheet info?

THanks very much.

Dave
0
Comment
Question by:dgriswold1
  • 2
5 Comments
 
LVL 35

Accepted Solution

by:
[ fanpages ] earned 500 total points
ID: 39198720
Hi Dave,

Does this happen if the inexperienced user creates the macro within ("Store macro in") "This Workbook" (rather than "New Workbook" or "Personal Macro Workbook") as specified upon the "Record macro" window?

Once stored within "This Workbook", the recorded macro code can be cut'n'pasted to the "Personal Macro Workbook".

However, I appreciate from what you have said, that this may (also) be a non-trivial task for somebody with limited experience.

BFN,

fp.
0
 

Author Comment

by:dgriswold1
ID: 39199801
Thanks for the suggestion, I'll go and test it now...much appreciated.
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39201429
Was your test successful, Dave?
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel IF formula 3 21
And OR formula 5 23
Excel - conditional formatting on several columns 9 38
VBA to add shapes inside a chart 9 20
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

822 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