Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default GetUsedRange Property does not release RAM.

I have encountered the problem with a Worksheet that does not release RA
after a row delete that is discussed in Article Q163263. The solutio
suggested in Q163263 does not work for Excel 9.0.2720

Given 21 rows of data on a worksheet, if I delete the 21st row, the
run the macro
Sub Reset_Range(
ActiveSheet.UsedRang
End Su

Then I use the Edit Menu - Go To, Special, Last Cel
Excel 9 still selects the rightmost cell in row 21, should be row 20
If I save the workbook, then the UsedRange property is reset, as i
was with Office 95.
Q163263 says the UsedRange property will release the unused RAM as of Excel 97. I
doesn't. What happened between Office 97 and Office 2000

I'm conducting these same operations using Autmation with MFC and getting the same results.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default GetUsedRange Property does not release RAM.

UsedRange is a property, not a method, so your code does
nothing. I guess the KB article is just wrong.
AFAIK saving the file & re-opening it is the only way to
reset the used range.


Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
I have encountered the problem with a Worksheet that

does not release RAM
after a row delete that is discussed in Article

Q163263. The solution
suggested in Q163263 does not work for Excel 9.0.2720.

Given 21 rows of data on a worksheet, if I delete the

21st row, then
run the macro:
Sub Reset_Range()
ActiveSheet.UsedRange
End Sub

Then I use the Edit Menu - Go To, Special, Last Cell
Excel 9 still selects the rightmost cell in row 21,

should be row 20.
If I save the workbook, then the UsedRange property is

reset, as it
was with Office 95.
Q163263 says the UsedRange property will release the

unused RAM as of Excel 97. It
doesn't. What happened between Office 97 and Office

2000?

I'm conducting these same operations using Autmation

with MFC and getting the same results.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default GetUsedRange Property does not release RAM.

I was pretty upset moving to 2000 finding that 'dummy =
UsedRange.Rows.Count' no longer worked.
In XL97, just accessing that property would reset the UsedRange. From 2000
onward it appears it's only ever reset on save.

This routine will find the last occupied cell within the UsedRange. Be sure
to Activate the sheet you're after first.

Sub test()
Dim lngLastRow As Long, lngLastCol As Long

On Error Resume Next
lngLastRow = 1: lngLastCol = 1
With ActiveSheet.UsedRange
lngLastRow = .Find("*", .Cells(1), xlFormulas, _
xlWhole, xlByRows, xlPrevious).Row
lngLastCol = .Find("*", .Cells(1), xlFormulas, _
xlWhole, xlByColumns, xlPrevious).Column
.Cells(lngLastRow, lngLastCol).Select
End With
End Sub


"Chelms" wrote in message
...
I have encountered the problem with a Worksheet that does not release RAM
after a row delete that is discussed in Article Q163263. The solution
suggested in Q163263 does not work for Excel 9.0.2720.

Given 21 rows of data on a worksheet, if I delete the 21st row, then
run the macro:
Sub Reset_Range()
ActiveSheet.UsedRange
End Sub

Then I use the Edit Menu - Go To, Special, Last Cell
Excel 9 still selects the rightmost cell in row 21, should be row 20.
If I save the workbook, then the UsedRange property is reset, as it
was with Office 95.
Q163263 says the UsedRange property will release the unused RAM as of

Excel 97. It
doesn't. What happened between Office 97 and Office 2000?

I'm conducting these same operations using Autmation with MFC and getting

the same results.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default GetUsedRange Property does not release RAM.

Sub piuhpji()
ActiveSheet.UsedRange
End Sub

The above works fine for me in simple cases when I delete row 21 as
described below, in Excel 2000.
But I agree that there are a number of more complex cases when it wont work.

Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm

"Rob van Gelder" wrote in message
...
I was pretty upset moving to 2000 finding that 'dummy =
UsedRange.Rows.Count' no longer worked.
In XL97, just accessing that property would reset the UsedRange. From 2000
onward it appears it's only ever reset on save.

This routine will find the last occupied cell within the UsedRange. Be

sure
to Activate the sheet you're after first.

Sub test()
Dim lngLastRow As Long, lngLastCol As Long

On Error Resume Next
lngLastRow = 1: lngLastCol = 1
With ActiveSheet.UsedRange
lngLastRow = .Find("*", .Cells(1), xlFormulas, _
xlWhole, xlByRows, xlPrevious).Row
lngLastCol = .Find("*", .Cells(1), xlFormulas, _
xlWhole, xlByColumns, xlPrevious).Column
.Cells(lngLastRow, lngLastCol).Select
End With
End Sub


"Chelms" wrote in message
...
I have encountered the problem with a Worksheet that does not release

RAM
after a row delete that is discussed in Article Q163263. The solution
suggested in Q163263 does not work for Excel 9.0.2720.

Given 21 rows of data on a worksheet, if I delete the 21st row, then
run the macro:
Sub Reset_Range()
ActiveSheet.UsedRange
End Sub

Then I use the Edit Menu - Go To, Special, Last Cell
Excel 9 still selects the rightmost cell in row 21, should be row 20.
If I save the workbook, then the UsedRange property is reset, as it
was with Office 95.
Q163263 says the UsedRange property will release the unused RAM as of

Excel 97. It
doesn't. What happened between Office 97 and Office 2000?

I'm conducting these same operations using Autmation with MFC and

getting
the same results.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default GetUsedRange Property does not release RAM.

This is worrisome. Sometimes it works, sometimes it doesn't.

It consistently works if I run the macro on a fresh worksheet. However, when I do a GetUsedRange Invoke from MFC, it always fails. In fact if I run the Macro on the worksheet following MFC, the Macro fails. More to follow.
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
Cursor Release KLA Excel Discussion (Misc queries) 6 March 6th 07 12:48 PM
Is this release buggy? Matt Morgan Excel Discussion (Misc queries) 1 December 19th 06 03:44 PM
Release Memory Jeff Excel Discussion (Misc queries) 1 September 25th 06 09:28 PM
Suggestions for the Next Release ExcelPro Excel Discussion (Misc queries) 0 May 24th 06 07:45 AM
Cannot release cell MEvans Excel Discussion (Misc queries) 1 January 29th 05 02:06 PM


All times are GMT +1. The time now is 01:56 AM.

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

About Us

"It's about Microsoft Excel"