Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Tom Ogilvy please help : File size getting large

Hi Tom,

I have a file that work add a new WB and save it to another directory,
but I have a problem with the size of that file is gained ... why ?
from 92kb to 6mb
Before saving I use :
Public Wb as Workbook

I use Wb in procedure1 and reuse Wb in procedure2,
I assumed that Public Wb is can be used from another procedure
during runtime ... is that right ?

I thought that before automation I've crashed the Excel memory or
temporary file, is it possible ?

Any help will be appreciated .... :)
Rgds,

Halim.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Tom Ogilvy please help : File size getting large

Workbook size is can be affected by many things. Excel maintains a
UsedRange property for each sheet. It describes the smallest rectangular
area that Excel had determined it needs to maintain information about. The
remainder of the worksheet is essentially virtual. It is possible that your
code is causing Excel to consider that a larger rectangle must be used. An
example would be this code

Range("A1").Value = 3

Range("IV65536").Value = 5

a demo from the immediate window with the activesheet being a new blank
sheet:

? activesheet.usedrange.Address, activesheet.usedRange.count
$A$1 1
Range("A1").Value = 1
Range("IV65536").Value = 3
? activesheet.usedrange.Address, activesheet.usedRange.count
$1:$65536 16777216

So you see excel has gone from maintaining information on 1 cell to
maintaining information on 16,777,216 cells. This obviously makes the file
size larger when excel writes information on so many more cells. And this
is just one sheet.

While this example is contrived, it is possible your code is causing
something similar to happen.

Here is a discussion on Debra Dalgleish's site:
http://www.contextures.com/xlfaqApp.html#Unused

--
Regards,
Tom Ogilvy


wrote in message
ups.com...
Hi Tom,

I have a file that work add a new WB and save it to another directory,
but I have a problem with the size of that file is gained ... why ?
from 92kb to 6mb
Before saving I use :
Public Wb as Workbook

I use Wb in procedure1 and reuse Wb in procedure2,
I assumed that Public Wb is can be used from another procedure
during runtime ... is that right ?

I thought that before automation I've crashed the Excel memory or
temporary file, is it possible ?

Any help will be appreciated .... :)
Rgds,

Halim.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default Tom Ogilvy please help : File size getting large

Hi Tom,
I've cleared the contents of used range that no more than a huge range
that
had been used ... but I've done with that problem ... but still don't
know why ?

many thanks for your exlanation ...

I think that's an office Excel Bugs ...
sorry for the lateness posting this ...

Regards,

Halim

Tom Ogilvy menuliskan:
Workbook size is can be affected by many things. Excel maintains a
UsedRange property for each sheet. It describes the smallest rectangular
area that Excel had determined it needs to maintain information about. The
remainder of the worksheet is essentially virtual. It is possible that your
code is causing Excel to consider that a larger rectangle must be used. An
example would be this code

Range("A1").Value = 3

Range("IV65536").Value = 5

a demo from the immediate window with the activesheet being a new blank
sheet:

? activesheet.usedrange.Address, activesheet.usedRange.count
$A$1 1
Range("A1").Value = 1
Range("IV65536").Value = 3
? activesheet.usedrange.Address, activesheet.usedRange.count
$1:$65536 16777216

So you see excel has gone from maintaining information on 1 cell to
maintaining information on 16,777,216 cells. This obviously makes the file
size larger when excel writes information on so many more cells. And this
is just one sheet.

While this example is contrived, it is possible your code is causing
something similar to happen.

Here is a discussion on Debra Dalgleish's site:
http://www.contextures.com/xlfaqApp.html#Unused

--
Regards,
Tom Ogilvy


wrote in message
ups.com...
Hi Tom,

I have a file that work add a new WB and save it to another directory,
but I have a problem with the size of that file is gained ... why ?
from 92kb to 6mb
Before saving I use :
Public Wb as Workbook

I use Wb in procedure1 and reuse Wb in procedure2,
I assumed that Public Wb is can be used from another procedure
during runtime ... is that right ?

I thought that before automation I've crashed the Excel memory or
temporary file, is it possible ?

Any help will be appreciated .... :)
Rgds,

Halim.


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
Large File Size Paula Excel Discussion (Misc queries) 3 October 13th 08 10:44 AM
File size getting large [email protected] Excel Programming 1 August 12th 06 06:16 PM
why is the size of my file so large? stevej12 Excel Discussion (Misc queries) 2 May 24th 05 05:38 PM
Excel file very large in size? Marc[_22_] Excel Programming 0 April 25th 05 09:36 PM
LARGE File Size John[_59_] Excel Programming 2 September 27th 03 11:41 PM


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