LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Slow Code

Hello gang -- I am writing an app in vb.net to manipulate some excel files.
the following code works fine on small files (1200 lines) but either takes
forever or fails on large files (67000 lines). im using excel 2007. for each
excel file, i create and instance of excel and leave open for saving
purposes. All this code does is trim the sheet.

AppExcel.Application.ScreenUpdating = False
Dim rng As Excel.Range
Dim wsh As Excel.Range

wsh = AppExcel.Application.ActiveSheet.UsedRange

For Each rng In wsh
rng.Value = LTrim(rng.Value)
Next rng
AppExcel.Application.ScreenUpdating = True

Any help is appreciated.
 
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
help with some slow code Matt S Excel Programming 0 February 2nd 09 05:57 PM
help with some slow code Matt S Excel Programming 0 February 2nd 09 01:24 PM
Fast code in 2003 = agonizingly slow code in 2007 XP Excel Programming 25 October 21st 08 01:01 PM
Slow code when used as VBA code instead of macro (copying visible columns) [email protected] Excel Programming 3 April 2nd 07 05:26 PM
Slow code quartz[_2_] Excel Programming 5 August 17th 06 02:33 AM


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