Run Time Error on activate coding

G

Guest

I have a macro with a piece of coding in it that has always worked in the
past. It is a simple command to activate a workbook or a worksheet within a
workbook.
For example
Workbooks("VAR Calc").Activate
or Workbooks("VAR Calc").Worksheets("Historical VaR").Activate
but now when I try and run the macro I get this very strange error message
"Run time error '-2147352565 (8002000b)': Can't move focus to the control
because it is invisible, not enabled, or of a type that does not accept the
focus."
and when I debug it shows that it gets stuck on the activation code.
this is even more stragne a if I run the macro on another computer it seems
to work. Any comments will be greatfully received.
 
N

NickHK

Referenceing workbooks without their extension (e.g. .xls), as in:
Workbooks("VAR Calc").Activate
will work on machines that have the Windows setting Folder Options> View>
"Hide file extensions for known types" checked.
However, this gives a subscript out of range error.

What do you get for
?Workbooks("VAR Calc").Windows(1).Visible

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top