ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Everthing worked fine and then....... (https://www.excelbanter.com/excel-programming/377245-everthing-worked-fine-then.html)

tinknocker

Everthing worked fine and then.......
 
Hello,
Thanks to information found on this group and other web sources I was
able to write my first Excel VBA program and it worked for several
months and then a problem arose.

A breif description of the program; Using Excel as a database to
retrieve material costs. The user clicks on a desktop shortcut and a
workbook loads behind a full screen user form. User selects material
type, gauge, and sheet size from drop down boxes and clicks a command
button to get pricing from up to (10) different vendors.

The workbook w/ the code resides on my machine (Win XP pro). Two
networked machines can access the code via a shortcut on their
desktops. Boss #1 has Win XP Home and boss #2 is running Win 98se ( due
to legacy software that will not run on XP). Boss #1 is working fine
but boss #2 now gets a "run-time error 9" "subscript out of range" when
he clicks the command button to get pricing.

Since the problem only affects 1 computer and even it could run the
program for several months, I don't know where to begin to solve this
problem.

TIA,
Tinknocker


Dave Peterson

Everthing worked fine and then.......
 
Just a complete guess.

I'm betting that you have code like:

windows("book1").activate
or
workbooks("book1").activate

Depending on a windows setting (not a version of windows, though), this may work
fine--or not.

Make sure you include the extension and those kinds of lines will work no matter
the windows setting.

windows("book1.xls").activate
or
workbooks("book1.xls").activate

======
If this doesn't help, you should post the snippet of code that causes the
problem. In general, subscript out of range means that you're trying to do
something to something that doesn't exist. Lots of times, it's caused by typos:

worksheets("shete1").select

(But that kind of typo wouldn't explain your problem.)

tinknocker wrote:

Hello,
Thanks to information found on this group and other web sources I was
able to write my first Excel VBA program and it worked for several
months and then a problem arose.

A breif description of the program; Using Excel as a database to
retrieve material costs. The user clicks on a desktop shortcut and a
workbook loads behind a full screen user form. User selects material
type, gauge, and sheet size from drop down boxes and clicks a command
button to get pricing from up to (10) different vendors.

The workbook w/ the code resides on my machine (Win XP pro). Two
networked machines can access the code via a shortcut on their
desktops. Boss #1 has Win XP Home and boss #2 is running Win 98se ( due
to legacy software that will not run on XP). Boss #1 is working fine
but boss #2 now gets a "run-time error 9" "subscript out of range" when
he clicks the command button to get pricing.

Since the problem only affects 1 computer and even it could run the
program for several months, I don't know where to begin to solve this
problem.

TIA,
Tinknocker


--

Dave Peterson

Gary Keramidas

Everthing worked fine and then.......
 
may be a solution to your excel problem, but this is what i would do anyway.
download a copy of microsoft virtual pc. buy yourself another copy of xp and
install it . install virtual pc and then install win98 on the virtual pc. when
he needs the legacy app, he can boot into the virtual 98 os and run it.

just make sure the pc is powerful enough to run both os's at the same time. i've
even ghosted an image to the virtual pc so i didn't have to install all of the
apps.

http://www.microsoft.com/windows/virtualpc/default.mspx

--


Gary


"tinknocker" wrote in message
ps.com...
Hello,
Thanks to information found on this group and other web sources I was
able to write my first Excel VBA program and it worked for several
months and then a problem arose.

A breif description of the program; Using Excel as a database to
retrieve material costs. The user clicks on a desktop shortcut and a
workbook loads behind a full screen user form. User selects material
type, gauge, and sheet size from drop down boxes and clicks a command
button to get pricing from up to (10) different vendors.

The workbook w/ the code resides on my machine (Win XP pro). Two
networked machines can access the code via a shortcut on their
desktops. Boss #1 has Win XP Home and boss #2 is running Win 98se ( due
to legacy software that will not run on XP). Boss #1 is working fine
but boss #2 now gets a "run-time error 9" "subscript out of range" when
he clicks the command button to get pricing.

Since the problem only affects 1 computer and even it could run the
program for several months, I don't know where to begin to solve this
problem.

TIA,
Tinknocker





All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com