Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Opening/Closing a lot of groupings via VBA

Hello,

I have a workbook with about 10.000 rows with about 300 vertical
groupings in it. In my program I have to close/open all the groupings
from time to time via VBA.
So I loop through all rows (1 to 10.000) and set the
"ShowDetail"-property of all rows to TRUE/FALSE - ignoring the errors
occuring for rows having no grouping.
But this takes about 20s what is quite too long for the user to wait
for. So does anybody have any idea how I could speed up
opening/closing all groupings?
I also have used "ActiveSheet.Outline.Showlevels" - but that is nearly
the same (due to performance) and has some other problems (e.g. on
closing I have to call it 8 times - once with "RowLevels:=8, once with
:=7... :=1).

So if you have any suggestion the please let me know.

Thanks in advance.
Dirk
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Opening/Closing a lot of groupings via VBA

You're hiding all or showing all???

If yes, then how about just doing it twice:

ActiveSheet.Outline.ShowLevels 1

and later:

ActiveSheet.Outline.ShowLevels 8

If you wanted to just see some of the outline, I can see why you'd want to
loop--but not all or one.



Dirk Flakowski wrote:

Hello,

I have a workbook with about 10.000 rows with about 300 vertical
groupings in it. In my program I have to close/open all the groupings
from time to time via VBA.
So I loop through all rows (1 to 10.000) and set the
"ShowDetail"-property of all rows to TRUE/FALSE - ignoring the errors
occuring for rows having no grouping.
But this takes about 20s what is quite too long for the user to wait
for. So does anybody have any idea how I could speed up
opening/closing all groupings?
I also have used "ActiveSheet.Outline.Showlevels" - but that is nearly
the same (due to performance) and has some other problems (e.g. on
closing I have to call it 8 times - once with "RowLevels:=8, once with
:=7... :=1).

So if you have any suggestion the please let me know.

Thanks in advance.
Dirk


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Opening/Closing a lot of groupings via VBA

Hello Dave,

thanks for your answer. With that I have one problem: All rows and
columns which are not used are hidden and the worksheet contains a lot
of comments. Then on using that statement I get the following error (I
try to translate the German message):
"Objects can't be moved over the border"

So before using the statement I have to make a few rows/columns
visible, execute the statement and then make them invisible again.
That works fine but then it also takes quite long - especially on
closing all as I have to execute the statement there 8 times (once for
each level) so that really all groupings are closed.

Thanks
Dirk

On Wed, 15 Dec 2004 20:57:28 -0600, Dave Peterson
wrote:

You're hiding all or showing all???

If yes, then how about just doing it twice:

ActiveSheet.Outline.ShowLevels 1

and later:

ActiveSheet.Outline.ShowLevels 8

If you wanted to just see some of the outline, I can see why you'd want to
loop--but not all or one.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Opening/Closing a lot of groupings via VBA

maybe this'll help:

XL: "Cannot Shift Objects Off Sheet" Error Hiding Columns
http://support.microsoft.com/default...b;en-ca;211769

(It sounds kind of like it may match your translation.)

Dirk Flakowski wrote:

Hello Dave,

thanks for your answer. With that I have one problem: All rows and
columns which are not used are hidden and the worksheet contains a lot
of comments. Then on using that statement I get the following error (I
try to translate the German message):
"Objects can't be moved over the border"

So before using the statement I have to make a few rows/columns
visible, execute the statement and then make them invisible again.
That works fine but then it also takes quite long - especially on
closing all as I have to execute the statement there 8 times (once for
each level) so that really all groupings are closed.

Thanks
Dirk

On Wed, 15 Dec 2004 20:57:28 -0600, Dave Peterson
wrote:

You're hiding all or showing all???

If yes, then how about just doing it twice:

ActiveSheet.Outline.ShowLevels 1

and later:

ActiveSheet.Outline.ShowLevels 8

If you wanted to just see some of the outline, I can see why you'd want to
loop--but not all or one.




--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Opening/Closing a lot of groupings via VBA

Hello Dave,

yese this is the message I receive. I will try if it is a solution for
me as soon as I will have time to do so.

Thank you very much!
Dirk

On Thu, 16 Dec 2004 18:21:36 -0600, Dave Peterson
wrote:

maybe this'll help:

XL: "Cannot Shift Objects Off Sheet" Error Hiding Columns
http://support.microsoft.com/default...b;en-ca;211769

(It sounds kind of like it may match your translation.)


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
Closing a workbook upon opening another Dave New Users to Excel 3 January 3rd 07 09:57 PM
Event on opening/closing groupings in VBA Dirk Flakowski Excel Discussion (Misc queries) 3 November 29th 05 03:52 PM
Opening and closing many spreadsheets from .NET Kyle Baley Excel Programming 10 June 21st 04 12:03 PM
Opening and closing workbook with VBA... Trevor[_4_] Excel Programming 1 March 4th 04 08:33 PM
Opening and Closing workbooks Jase Excel Programming 1 October 15th 03 06:28 AM


All times are GMT +1. The time now is 12:26 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"