+ Reply to Thread
Results 1 to 2 of 2

macro calling from personalwb.xlsb - what was the previous workbook?

  1. #1
    Registered User
    Join Date
    04-29-2016
    Location
    Budapest, Hungary
    MS-Off Ver
    win 7, Office 2007
    Posts
    3

    macro calling from personalwb.xlsb - what was the previous workbook?

    HI!
    I have written a macro what need to use my colleges during their works.
    They get 200 excels a day, and they have to use to make contracts...
    This workbooks are wrong. My colleges have to change the x character to y in some cells...
    My plan is that:
    I save my macro to their computers, to their excels personalworkbook.xlsb, and I take an little icon to their excels quick access toolbar...

    My problem:
    My college open one source excel of the 200... He start running my macro. My macro start in his personalwb.xlsb... But, my macro don't know, which excel does he calling from???

    Could somebody to help, how can i reference the previous workbook in my macro, what hasn't run in the source, previous excels?

    Thenk you!
    John
    Last edited by giani1984; 01-31-2018 at 01:58 PM.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: macro calling from personalwb.xlsb - what was the previous workbook?

    In your macro in Personnal.xlsb, you can use ActiveWorkbook.Name to know which workbook called the macro.
    ActiveSheet would refer to the active sheet where Excel was when the macro was called.
    It should be as simple as that.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Calling macro from another workbook
    By garveyarmy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-18-2017, 07:19 AM
  2. can't see macro moved from workbook into personal.xlsb
    By whburling in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2017, 01:26 AM
  3. [SOLVED] Call a Macro in the Active Workbook from a Personal.xlsb procedure [RESOLVED]
    By Seke in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2015, 06:17 AM
  4. [SOLVED] Anyway to skip reference to personal.xlsb when calling functions
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-17-2014, 02:00 PM
  5. Add procedure to PERSONAL.XLSB with a macro from another workbook.
    By dimattia in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2013, 10:21 AM
  6. Run-Time Error 1004 When Running Macro from Another Personal Workbook (xlsb)
    By vcs1161 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-01-2013, 12:05 PM
  7. Move or copy macro from Personal.xlsb to workbook
    By kazphilips in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 05:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1