+ Reply to Thread
Results 1 to 5 of 5

Running a Function or macro of child file from a Master file

  1. #1
    Registered User
    Join Date
    04-22-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    47

    Running a Function or macro of child file from a Master file

    Hi Guys
    I do need your help regarding one of my projects in which I ‘m trying out to run a function of a closed file from and active file In this case I do have 2 files Master and process
    In both there’s a combo box control which help me revolve the data on basis of month As the case when combo box of process file is changed data is being revolved according to month
    What I need to do is
    When I change the combo box of MASTER file the change should reflect in the process file As function runs updates the process files value and file saved and closed
    Thanks & Regards
    Ravinder S
    (Ravinder_tigh)

  2. #2
    Registered User
    Join Date
    04-22-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Running a Function or macro of child file from a Master file

    Here’s the code for master file which I’m using to run function MB of process file

    Please Login or Register  to view this content.
    Here’s da code for process file
    Please Login or Register  to view this content.
    When I run the master file code with different file and functions it runs fine but

    For this process file it generates an error Error no 1004 Macro couldn’t found “filename!function name”

    Plz help me with this debugging I’m really tired up trying to sort this issue

    I’d be really thankful

    Regards
    Ravinder S
    Attached Files Attached Files

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Running a Function or macro of child file from a Master file

    You cannot run code from a closed file. maybe you could create an addin(*.xla) to hold the code.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    04-22-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Running a Function or macro of child file from a Master file

    No I'm Not runnning the code from the closed file but i jst do it through master code
    in which
    i jst open the file
    runs the application.run() part
    save that opened file and close it

    my area of concern is when i open the file it works fine but as code moves to next line
    str = Application.Run(wbTarget & "!" & "MB", Num)
    it created that error 1004
    function dosen't exists

    May be file could help u better understand

    download both and run master file's code

    Thanks And Regards,
    Ravinder S
    Last edited by ravinder_tigh; 06-01-2009 at 02:29 AM.

  5. #5
    Registered User
    Join Date
    04-22-2009
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    47

    Re: Running a Function or macro of child file from a Master file

    i' had debugged the application and find out the problem when ever in master i suppy the file name as a string and if file name do hav spaces in between then it dosen't consider this as a [VBA]str = Application.Run(wbTarget & "!" & "MB", Num)[/VBA]



    if i initialize wbtarget as workbook it could be done but i don't know how to set wbtarget with that file name could u plz help me with this issue



    Regards,
    Ravinder S

+ 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