Solved

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

Posted on 2013-05-26
5
205 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
[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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
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 …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

726 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