+ Reply to Thread
Results 1 to 4 of 4

Getting an error when calling multiple subs from a single module

  1. #1
    Forum Contributor
    Join Date
    05-29-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    143

    Getting an error when calling multiple subs from a single module

    Hello,

    I have been working on this inventory project for the past month and it's working great, but I've tried creating a dashboard to get an overview of the whole system and to be able to control it from the dashboard. I've created a bunch of different modules (I have over 10) that each control a different aspect of the the workbook (i.e., broken down by worksheet and import/export). I'm not trying to create the Update macro for the dashboard. This macro will run a number of other subs from different modules in order to purge old items and update new items.

    The bug that I'm getting now is when I run "PullSalesData.VBA_Read_External_Workbook" - this sub extracts data from another workbook and pulls it into the Sales Worksheet of the Inventory system. However, when it runs in the Dash Macro, it crashes. The problem comes down to this line =

    Please Login or Register  to view this content.
    This code is supposed to sort the data in the Sales Worksheet of the inventory system, but instead it wants to sort it in the dashboard, even though it's running on the Sales Module. Here's the dasboard macro:

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,343

    Re: Getting an error when calling multiple subs from a single module

    So are you saying it gets "oneRange" wrong?
    maybe you need to at least show us where it defines "oneRange".

    maybe step through the macro and confirm if that is the case.

  3. #3
    Forum Contributor
    Join Date
    05-29-2013
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    143

    Re: Getting an error when calling multiple subs from a single module

    Well oneRange is part of the sub of DashPurchPull.purchPull, which only acts on the Purchasing Worksheet, but it acts on the Dashboard worksheet. Does that make sense?

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Getting an error when calling multiple subs from a single module

    Hi,

    You need to at least show us the full code for the routine that crashes since it appears that is where the problem actually is.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

+ 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. Teach me how to run multiple subs in one module, please?
    By arwebb0264 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-19-2016, 01:42 PM
  2. Multiple subs calling "Declarations" from a singular module
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-02-2014, 12:16 PM
  3. Module Subs executing Private Subs without prompt by code - Totally Lost
    By Ozan Ertem in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 12-26-2012, 05:31 PM
  4. Running multiple subs in one module.
    By ZEvans12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2011, 01:03 PM
  5. Calling other subs
    By noodle48 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-30-2011, 10:56 AM
  6. Error calling a procedure not in a module
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2009, 03:03 AM
  7. [SOLVED] Single Macro containing multiple subs
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2006, 09:25 PM

Tags for this Thread

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