Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default ActiveSheet & Apropriate Reference

Hello,

I am trying to use the following bit of code and I am having trouble. I
believe I am missing a reference in the tools menu because when I type
ActiveSheet. nothing appears afterwards. If I had the right library loaded
then it should appear. Does anyone have any ideas of how I can find out which
library to use?

ActiveSheet.PivotTables("FocusMktList").RefreshTab le

These are the libraries that I have loaded
- Visual Basic For Applications
- Microsoft Excel 9.0
- OLE Automation
- Mcirosoft Office 9.0
- Microsoft Forms 2.0 Library

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ActiveSheet & Apropriate Reference

What you observe is correct. Activesheet is ambiguous - like selection. To
illustrate from the immediate window:

? typename(Activesheet)
Worksheet
? typename(Activesheet)
Chart

The feature you speak of does not try to resolve the object within the
current context.

--
Regards,
Tom Ogilvy


"James C." wrote:

Hello,

I am trying to use the following bit of code and I am having trouble. I
believe I am missing a reference in the tools menu because when I type
ActiveSheet. nothing appears afterwards. If I had the right library loaded
then it should appear. Does anyone have any ideas of how I can find out which
library to use?

ActiveSheet.PivotTables("FocusMktList").RefreshTab le

These are the libraries that I have loaded
- Visual Basic For Applications
- Microsoft Excel 9.0
- OLE Automation
- Mcirosoft Office 9.0
- Microsoft Forms 2.0 Library

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default ActiveSheet & Apropriate Reference

Not sure I understand. I have this type of code throughtout my module. I have
never had any problems running it until just recently. I ran this on a newer
version of excel, the module crashed and gives me the following error.

"Unable to get the PivotTables property of the Worksheet class"

I get this on everysingle one of my ActiveSheet...... lines?

Any ideas.



"Tom Ogilvy" wrote:

What you observe is correct. Activesheet is ambiguous - like selection. To
illustrate from the immediate window:

? typename(Activesheet)
Worksheet
? typename(Activesheet)
Chart

The feature you speak of does not try to resolve the object within the
current context.

--
Regards,
Tom Ogilvy


"James C." wrote:

Hello,

I am trying to use the following bit of code and I am having trouble. I
believe I am missing a reference in the tools menu because when I type
ActiveSheet. nothing appears afterwards. If I had the right library loaded
then it should appear. Does anyone have any ideas of how I can find out which
library to use?

ActiveSheet.PivotTables("FocusMktList").RefreshTab le

These are the libraries that I have loaded
- Visual Basic For Applications
- Microsoft Excel 9.0
- OLE Automation
- Mcirosoft Office 9.0
- Microsoft Forms 2.0 Library

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ActiveSheet & Apropriate Reference

I was talking about your test for the proper library by checking activesheet.

Pivottable objects are in the Excel object library.

I suspect you have created a variable or a procedure with the name
activesheet. This is masking the true activesheet object.

--
Regards,
Tom Ogilvy




"James C." wrote:

Not sure I understand. I have this type of code throughtout my module. I have
never had any problems running it until just recently. I ran this on a newer
version of excel, the module crashed and gives me the following error.

"Unable to get the PivotTables property of the Worksheet class"

I get this on everysingle one of my ActiveSheet...... lines?

Any ideas.



"Tom Ogilvy" wrote:

What you observe is correct. Activesheet is ambiguous - like selection. To
illustrate from the immediate window:

? typename(Activesheet)
Worksheet
? typename(Activesheet)
Chart

The feature you speak of does not try to resolve the object within the
current context.

--
Regards,
Tom Ogilvy


"James C." wrote:

Hello,

I am trying to use the following bit of code and I am having trouble. I
believe I am missing a reference in the tools menu because when I type
ActiveSheet. nothing appears afterwards. If I had the right library loaded
then it should appear. Does anyone have any ideas of how I can find out which
library to use?

ActiveSheet.PivotTables("FocusMktList").RefreshTab le

These are the libraries that I have loaded
- Visual Basic For Applications
- Microsoft Excel 9.0
- OLE Automation
- Mcirosoft Office 9.0
- Microsoft Forms 2.0 Library

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default ActiveSheet & Apropriate Reference

You don't get Intellisense support because ActiveSheet isn't
always a worksheet. It might be a chart sheet.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"James C." wrote in message
...
Hello,

I am trying to use the following bit of code and I am having
trouble. I
believe I am missing a reference in the tools menu because when
I type
ActiveSheet. nothing appears afterwards. If I had the right
library loaded
then it should appear. Does anyone have any ideas of how I can
find out which
library to use?

ActiveSheet.PivotTables("FocusMktList").RefreshTab le

These are the libraries that I have loaded
- Visual Basic For Applications
- Microsoft Excel 9.0
- OLE Automation
- Mcirosoft Office 9.0
- Microsoft Forms 2.0 Library



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
activesheet Jim at Eagle Excel Programming 1 April 6th 05 12:21 AM
Get ActiveSheet name in VB Geoff Lambert[_2_] Excel Programming 1 October 8th 04 02:25 PM
name of the activesheet rasta Excel Programming 1 October 3rd 03 09:49 PM
ActiveSheet.Name? Andrew Stedman Excel Programming 5 July 30th 03 01:17 PM
ActiveSheet Ron de Bruin Excel Programming 0 July 29th 03 04:59 PM


All times are GMT +1. The time now is 12:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"