VBE object in 2010

W

WhytheQ

Hopefully someone can help!

I've been running various routines in workbooks using vb
scripts...successfully for the past 5 yrs. Just upgraded to 2010 and
various bits of code are now struggling. Admittedly my code could do
with tidying up but it's generally a bit of a head-ache.

One thingthat throws a vb script error is if the following line is
included in any of my workbook macros:

Application.VBE.MainWindow.Visible = False

.....anybody know why this is happening as it wasn't a problem in 2007?

Any help much appreciated,
J
 
G

GS

WhytheQ explained :
Hopefully someone can help!

I've been running various routines in workbooks using vb
scripts...successfully for the past 5 yrs. Just upgraded to 2010 and
various bits of code are now struggling. Admittedly my code could do
with tidying up but it's generally a bit of a head-ache.

One thingthat throws a vb script error is if the following line is
included in any of my workbook macros:

Application.VBE.MainWindow.Visible = False

....anybody know why this is happening as it wasn't a problem in 2007?

Any help much appreciated,
J

I haven't installed 2010 yet because none of my clients use it. But...

What's the error message? Is '.VBE.MainWindow' a valid object in 2010?
OR '.VBE.MainWindow.Visible' a valid property setting? If not, you may
have to modify your code so it version-aware.
 
W

WhytheQ

WhytheQ explained :











I haven't installed 2010 yet because none of my clients use it. But...

What's the error message? Is '.VBE.MainWindow' a valid object in 2010?
OR '.VBE.MainWindow.Visible' a valid property setting? If not, you may
have to modify your code so it version-aware.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -

Hello Garry
It is a valid object and a valid property setting in 2010 so no need
to make the code version aware.
When the .vbs file runs it fails on Line 8 (which is the reference to
the Public macro in the workbook) and the Windows Script Host error
message says:

Char: 1
Error: System call failed
Code: 80010100
Source: (null)

.....if I comment out the line that references the VBE then the vbs
file runs fine.
The VBE line of code is not vital but I've spent 3hrs tracking this
error down and was wondering if Microsoft have got a time machine and
could give me this time back please!

J
 
G

GS

WhytheQ brought next idea :
Hello Garry
It is a valid object and a valid property setting in 2010 so no need
to make the code version aware.
When the .vbs file runs it fails on Line 8 (which is the reference to
the Public macro in the workbook) and the Windows Script Host error
message says:

Char: 1
Error: System call failed
Code: 80010100
Source: (null)

....if I comment out the line that references the VBE then the vbs
file runs fine.
The VBE line of code is not vital but I've spent 3hrs tracking this
error down and was wondering if Microsoft have got a time machine and
could give me this time back please!

J

Ok J, I'm not sure now how to direct you because you speak to using
VBScript and not VBA. The VBE only knows VBA by default so unless you
explicitly ref objects in your VBS, you can't run .vbs in VBA modules.
<BTW>VBA uses .bas, .frm, and .cls files only. Can you post the entire
code so we can see where/how the problem arises?
 
Top