+ Reply to Thread
Results 1 to 4 of 4

Problems with defining global variables

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    33

    Problems with defining global variables

    Hi,
    I have three modules- A,B,C with the following code as seen below. When I try to run sub Main it crashes when it tries to call ReadData without any error messages even if I use On Error GoTo.... If I remove pix in the global definition it does not crash in ReadData on that line. But it still crashes on line with "sh(1)="name 1". What is wrong here? I need to use the variables in a lot of subroutines therefore I use Global.

    Module A
    Please Login or Register  to view this content.
    Module B
    Please Login or Register  to view this content.
    Module C
    Please Login or Register  to view this content.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Problems with defining global variables

    Do you have any addins loaded? This sounds like your Excel is corrupted or an addin is, so Excel may need reinstalling - this isn't normal behaviour.

    Another thought, are you using any windows APIS?

  3. #3
    Registered User
    Join Date
    04-03-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Problems with defining global variables

    I have the following Add-Ins in Excel
    Analysis-ToolPak
    Analysis-ToolPak - VBA

    and there are no Addins in VBA. The Add-In Manager is empty and I can not choose any.

  4. #4
    Registered User
    Join Date
    04-03-2012
    Location
    Stockholm
    MS-Off Ver
    Excel 2003
    Posts
    33

    Re: Problems with defining global variables

    I have the four first selection in References
    Visual Basic for Applications
    MS Excel 14.0 Object Library
    OLE Automation
    MS Office 14.0 Object Library

+ 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] Defining Global Variable from form to sheet
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-30-2013, 06:08 PM
  2. [SOLVED] keep the global variables
    By Mike Archer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-03-2006, 02:40 PM
  3. Global Variables
    By mattsvai in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-03-2006, 01:10 PM
  4. global variables
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2005, 07:50 PM
  5. [SOLVED] problems defining a global variable
    By filo666 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2005, 06:05 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