Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module level variable going out of scope

Status
Not open for further replies.

Quehay

Programmer
Feb 6, 2000
804
0
0
US
I've got an Excel object variable declared in the page-level declarations. I initialize it in a sub and then refer to the variable in other subs. It worked but has stopped working (getting "object required" errors when trying to refer to it).

This should not be happening, and it appears that the scripting host is closing the variable prematurely. Has anyone else experienced this?

Thanks!


Jeff Roberts
Insight Data Consulting
Access and SQL Server Development
 
Hello Quehay,

Maybe you need to reinstall the wsh over itself. (You know, it takes <10sec and seamless.) Make sure v5.6 latest.

regards - tsuji
 
tsuji,

Thanks--I wondered if maybe the dll was fried or something. I found an earlier version of the same script that ran correctly (I printed copies and there were NO DIFFERENCES in the problems areas). So I copied new subs/lines into the old script, and it ran. This was the most mysterious programming bug I've encountered.

Jeff


Jeff Roberts
Insight Data Consulting
Access and SQL Server Development
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top