ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA acting weird, advice plse. (https://www.excelbanter.com/excel-programming/332693-vba-acting-weird-advice-plse.html)

dpenny[_2_]

VBA acting weird, advice plse.
 

I write VBA in Excel once or twice a year. Thus, I use the immediat
window a lot to check every line I write.

Can someone explain the following in immediate window:
activesheet.name - give me OK result
activesheet. - does not give me a drop down of choices
activecell. - does give me a drop down of choices
activesheet.usedrange - gives me a run time error.

What is going on? Do I have wrong libraries or dlls being used? How d
I know, how do I check? How do you know which libraries ar
attached/in-use/available, whatever is the correct words?

Also, I thought I was using (always) VBA. About Help says I'm usin
VB6.3

--
dpenn
-----------------------------------------------------------------------
dpenny's Profile: http://www.excelforum.com/member.php...fo&userid=1970
View this thread: http://www.excelforum.com/showthread.php?threadid=38175


George Nicholson[_2_]

VBA acting weird, advice plse.
 
activesheet.usedrange - gives me a run time error.

Maybe you meant
?activesheet.usedrange.address

I have no explanation for why activesheet. doesn't activate AutoList.

--
George Nicholson

Remove 'Junk' from return address.


"dpenny" wrote in
message ...

I write VBA in Excel once or twice a year. Thus, I use the immediate
window a lot to check every line I write.

Can someone explain the following in immediate window:
activesheet.name - give me OK result
activesheet. - does not give me a drop down of choices
activecell. - does give me a drop down of choices
activesheet.usedrange - gives me a run time error.

What is going on? Do I have wrong libraries or dlls being used? How do
I know, how do I check? How do you know which libraries are
attached/in-use/available, whatever is the correct words?

Also, I thought I was using (always) VBA. About Help says I'm using
VB6.3.


--
dpenny
------------------------------------------------------------------------
dpenny's Profile:
http://www.excelforum.com/member.php...o&userid=19708
View this thread: http://www.excelforum.com/showthread...hreadid=381753




PaulD

VBA acting weird, advice plse.
 
"dpenny" wrote in
message ...
:
: I write VBA in Excel once or twice a year. Thus, I use the immediate
: window a lot to check every line I write.
:
: Can someone explain the following in immediate window:
: activesheet.name - give me OK result
: activesheet. - does not give me a drop down of choices

I quote this from a post by Stephen Bullen
"The reason is that some of Excel's 'global' objects, like ActiveSheet, can
refer to many different types of sheet, so it is declared 'As Object' in
the type library. It could, for example, by a Worksheet, a Chart, a
MacroSheet, a DialogSheet etc, so intellisense can't tell which type of
sheet to give you the indicators for.

When you declare a variable As Worksheet, intellisense knows that you're
refering to a Worksheet object; if the active sheet was any other type of
sheet when you ran your code, you'd get a run-time error.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk "

: activecell. - does give me a drop down of choices
: activesheet.usedrange - gives me a run time error.
:
: What is going on? Do I have wrong libraries or dlls being used? How do
: I know, how do I check? How do you know which libraries are
: attached/in-use/available, whatever is the correct words?

You can check your libraries available by using the object browser, or you
can open the reference window under the tools menu.

: Also, I thought I was using (always) VBA. About Help says I'm using
: VB6.3.

VBA is VB, and in the version of excel you are using it's VB6.3. The A
after VB just means it is meant to run in a specific application (i.e.
executable when run in excel) and not stand alone like VB which creates it's
own executable.
Paul D




All times are GMT +1. The time now is 11:15 PM.

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