+ Reply to Thread
Results 1 to 5 of 5

Macro not working while running multiple others macro..

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Macro not working while running multiple others macro..

    Hi,

    I am actually using 1 macro to open a folder using a command button and run multiple macro on the file. The macro that run on the file does split worksheet, and split each worksheet into separate excel file. But when I try to do it, it doesnt work.

    This is the open macro:
    Please Login or Register  to view this content.
    and the part that is not working is:
    Please Login or Register  to view this content.
    Any help will be thankful!

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Macro not working while running multiple others macro..

    The SplitFiles sub is setup to work on the workbook the code is in, ThisWorkbook, not the workbook that's been opened, wbk.

    Try passing wbk to SplitFiles as an argument.

    That might look something like this, though I can't be sure as you've not posted the header for SplitFiles.
    Please Login or Register  to view this content.
    You would now call SplitFiles from Split like this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    06-22-2011
    Location
    somerset
    MS-Off Ver
    365
    Posts
    328

    Re: Macro not working while running multiple others macro..

    you can replace all the sheet copy, paste and delete stuf with just.
    Please Login or Register  to view this content.
    Sub Reputation()
    Dim Problem as Variant
    Dim Reputation as Integer
    For Each Problem in Forum.Threads
        If Problem.Title = "*[Solved]*" and Solver.Name = "Leon V (AW)" Then Reputation = Reputation + 1
    Next Problem
    End Sub

  4. #4
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Macro not working while running multiple others macro..

    Quote Originally Posted by Norie View Post
    The SplitFiles sub is setup to work on the workbook the code is in, ThisWorkbook, not the workbook that's been opened, wbk.

    Try passing wbk to SplitFiles as an argument.

    That might look something like this, though I can't be sure as you've not posted the header for SplitFiles.
    Please Login or Register  to view this content.
    You would now call SplitFiles from Split like this.
    Please Login or Register  to view this content.
    Sorry, I did not totally paste the whole format macro, these doesn't work after I change the sub to wbk1:
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    440

    Re: Macro not working while running multiple others macro..

    I have tried to add this but it doesn't work..:
    Please Login or Register  to view this content.

+ 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. Need some help on keeping UNDO/REDO working after running macro's. Almost there ;-)
    By onidarbe in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 02:00 PM
  2. Macro for running the SQL multiple times
    By sawoodalam1989 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-27-2013, 07:00 AM
  3. [SOLVED] Allow users to edit ranges not working after running a Macro?!
    By Margate in forum Excel General
    Replies: 2
    Last Post: 02-15-2013, 07:42 AM
  4. Running Macro on multiple sheets
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 01-21-2013, 12:10 PM
  5. running macro on time not working
    By SJDANIELS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2008, 10:33 AM

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