+ Reply to Thread
Results 1 to 3 of 3

Macro one workbook to another

  1. #1
    MESTRELLA29
    Guest

    Macro one workbook to another

    I have the following Macro that is a Journal Entry, when I run the macro it
    opens a template and copies information from the active workbook to the
    template, what I need is to run in base of the current active workbook and
    not "2004 JE Worksheets NEW.xls").Activate, because this forces me to name
    the file always the same way.

    Let me know if i did not make myself clear

    Workbooks.Add Template:= _
    "C:\Documents and Settings\mestrell.000\Application
    Data\Microsoft\Templates\JE BPCS upload.xlt"
    Windows("2004 JE Worksheets NEW.xls").Activate



  2. #2
    Robin Hammond
    Guest

    Re: Macro one workbook to another

    Are you looking for something like this?

    Dim wSource as Workbook
    Set wSource = ActiveWorkbook

    Workbooks.Add Template:= _
    "C:\Documents and
    Settings\mestrell.000\ApplicationData\Microsoft\Templates\JE BPCS
    upload.xlt"

    wSouce.Activate

    'carry on from here

    Robin Hammond
    www.enhanceddatasystems.com

    "MESTRELLA29" <[email protected]> wrote in message
    news:[email protected]...
    >I have the following Macro that is a Journal Entry, when I run the macro it
    > opens a template and copies information from the active workbook to the
    > template, what I need is to run in base of the current active workbook and
    > not "2004 JE Worksheets NEW.xls").Activate, because this forces me to name
    > the file always the same way.
    >
    > Let me know if i did not make myself clear
    >
    > Workbooks.Add Template:= _
    > "C:\Documents and Settings\mestrell.000\Application
    > Data\Microsoft\Templates\JE BPCS upload.xlt"
    > Windows("2004 JE Worksheets NEW.xls").Activate
    >
    >




  3. #3
    MESTRELLA29
    Guest

    Re: Macro one workbook to another

    YES !!!!!!

    That is IT.... THANKS FOR ALL YOUR HELP...

    "Robin Hammond" wrote:

    > Are you looking for something like this?
    >
    > Dim wSource as Workbook
    > Set wSource = ActiveWorkbook
    >
    > Workbooks.Add Template:= _
    > "C:\Documents and
    > Settings\mestrell.000\ApplicationData\Microsoft\Templates\JE BPCS
    > upload.xlt"
    >
    > wSouce.Activate
    >
    > 'carry on from here
    >
    > Robin Hammond
    > www.enhanceddatasystems.com
    >
    > "MESTRELLA29" <[email protected]> wrote in message
    > news:[email protected]...
    > >I have the following Macro that is a Journal Entry, when I run the macro it
    > > opens a template and copies information from the active workbook to the
    > > template, what I need is to run in base of the current active workbook and
    > > not "2004 JE Worksheets NEW.xls").Activate, because this forces me to name
    > > the file always the same way.
    > >
    > > Let me know if i did not make myself clear
    > >
    > > Workbooks.Add Template:= _
    > > "C:\Documents and Settings\mestrell.000\Application
    > > Data\Microsoft\Templates\JE BPCS upload.xlt"
    > > Windows("2004 JE Worksheets NEW.xls").Activate
    > >
    > >

    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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