Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel Automation problem with AutoFilters

I've developed a VB application that does some OLE Automation using Excel.

I want to check that there is no autofilter currently active and that all
rows are shown (but still keep the AutoFilter enabled).

The code to this is within a VBA macro is

Activesheet.ShowAllData

(I believe)

However when I try to do this within VB e.g

Dim X as New Excel.Application
.......
X.ActiveSheet.ShowAllData

I get object does not support method.

Any ideas what I am doing wrong?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Excel Automation problem with AutoFilters

My guess is that the application is not visible, so nothing is active.
It is best when automating Excel to set object references
to all Excel objects and avoid the use of "Active...".
Try something like this...

Dim xlApp As Excel.Application
Dim WB As Excel.Workbook
Dim WS As Excel.Worksheet

Set xlApp = New Excel.Application
Set WB = xlApp.Workbooks.Add
Set WS = WB.Sheets(1)
'other stuff
WS.ShowAllData

Make sure to set all object variables to Nothing
when exiting Excel.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Nexus"
wrote in message
I've developed a VB application that does some OLE Automation using Excel.

I want to check that there is no autofilter currently active and that all
rows are shown (but still keep the AutoFilter enabled).
The code to this is within a VBA macro is
Activesheet.ShowAllData
(I believe)

However when I try to do this within VB e.g

Dim X as New Excel.Application
.......
X.ActiveSheet.ShowAllData

I get object does not support method.
Any ideas what I am doing wrong?


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
Excel automation problem Arvi Laanemets Excel Programming 3 April 13th 06 09:22 AM
Excel Automation Problem With Add-Ins pagates Excel Programming 4 October 6th 05 05:18 PM
Problem in graph automation in excel. news.microsoft.com[_7_] Excel Programming 3 April 30th 05 06:02 AM
TypeConverter Excel-Automation problem Markus Excel Programming 0 August 23rd 04 11:17 AM
Userforms and autofilters - Autofilters don't seen to work with userform No Name Excel Programming 3 August 28th 03 05:42 PM


All times are GMT +1. The time now is 04:35 PM.

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"