runtime error hide/unhide

  • Thread starter Thread starter Bruce Maston
  • Start date Start date
B

Bruce Maston

I have a worksheet called "UTILITY" that contains some
basic information. The Workbook.open event populates
variables with values from this sheet, and then the
UTILITY sheet is hidden. It works fine ON MY HOME MACHINE.

BUT ON MY OFFICE MACHINE, I get an error message unless
the UTILITY worksheet is always visible. In other words,
if I close my application with UTILITY visible, there is
no error message the next time I open the application. So
the work-around is to remove the line of code that hides
UTILITY.

But the question remains: Why the difference from one
machine to another? It would seem to be a configuration
problem with Excel or something that is "different"
between these two machines. I'm running W2K and Excel
2000.

Thank you for any insight.
 
I'd prefer the exact text content of the error message,
rather than an interpretation.
If you can't determine what it means you can usually do a
search on Excel newsgroups, or web pages.
http://groups.google.com/advanced_group_search?q=group:*Excel*&num=100
http://www.mvps.org/dmcritchie/excel/xlnews.htm

If the error message is one that you generated, you
can search your project library (libraries). Starting with
the first module in the workbook. Ctrl+F (FIND) and
check the option to search entire project library.

Perhaps you have something in ThisWorkbook, Auto_Open,
or in sheet activation that calls one of your macros, or an
addin.
 
Thank you for replying. To answer your questions,
the error is "runtime error 6 overflow"
When you hit debug, the yellow line is on
intRow = ActiveCell.Row

intRow is simply an integer variable
The value for ActiveCell.Row changes each time I run the
code, but it is always a small integer (between 30 and 60).

In my opinion, the "yellow" row is a red herring. As I
said, there is nothing wrong with this code when it runs
on my machine.

All of these machines have the following references and in
this order:

Visual Basic for Applications
Microsoft Excel 9.0 Object Library
OLE Automation
Microsoft Office 9.0 Object Library
Microsoft Forms 2.0 Object Library
Microsoft Scripting Runtime

The only difference between these machines is that mine is
using an "official" microsoft Office2000, and these other
machines are using Office2000 as supplied with a Dell
computer. But this shouldn't be a problem because I also
have a Dell machine running this application without a
problem.

To summarize, the bug occurs on these other machines when
the UTILITY worksheet is hidden with
Worksheets("UTILITY").Visible = False

This line causes no problem on my machine.
 
Hi <[email protected]> ,

Even though you say the active cell is on row 30,
I'd still fix the following and see what happens.

You should be using Long for rows (and columns) not Integer.
On the other hand are you really using more than
32,768 rows. First fix that variable in your code.

Check your lastcell Ctrl+End if is far from your
actual data you should fix that as well, see
Lastcell, Reset Last Used Cell
Reset All Lastcells in the Active Workbook (#resetall)
Making the activecell the LastCell (#MakeLastCell)
http://www.mvps.org/dmcritchie/excel/lastcell.htm#resetall

It would be a lot more friendly and professional to use your
first and last name when posting, so we know who we are talking to.
 
Hi David,

I'll change the variable to Long tomorrow and see what
happens on the other machines. I saw something about Long
in relation to the overflow error somewhere, but I hadn't
gotten around to it. The problem will still be, tho',
that this is not a problem on one machine but is on
another. It suggests to me that some update or some such
is missing (but all the machines have the latest updates
as of yesterday).

From my limited understanding, Excel can only "see"
information that has been pasted into a cell. Thus, when
the open event fires for my application, a SQL call is
made to a database to retrieve the names of the active
billing accounts. These account names are pasted onto the
UTILITY worksheet where they are, in turn, used to
populate a variable (varCaseName). The IntRow variable is
simply the last row of account names, and this becomes the
Ubound for the varCaseName [redim varCaseName(intRow -
1)]. So, even though I'm pround of it, it is really not a
very complicated code.

Thank you for taking the time to respond.

Bruce Maston
 
Back
Top