Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Runtime question in vb vs. vba

Hi. I was working on a project writing a macro with vba. i finished
writing my macro and decided to use vb to make a stand-alone executable
with numerous forms (as opposed to different excel files) for our
different tools. For some reason, the one tool took about an hour to
run in vba, but it is going much much slower in vb now when I try to
run it. Is this normal? Any ideas what I could be doing wrong to slow
down the process? Thanks!

Nick

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Runtime question in vb vs. vba

Not much chance to know what you are doing wrong without knowing what you
are doing.

RBS

wrote in message
oups.com...
Hi. I was working on a project writing a macro with vba. i finished
writing my macro and decided to use vb to make a stand-alone executable
with numerous forms (as opposed to different excel files) for our
different tools. For some reason, the one tool took about an hour to
run in vba, but it is going much much slower in vb now when I try to
run it. Is this normal? Any ideas what I could be doing wrong to slow
down the process? Thanks!

Nick


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Runtime question in vb vs. vba

Assuming you didn't make some mistake when transferring your code to VB....

When run in VBA your procedures are in the same process as the workbook(s), but when run from VB any references to XL must cross the
boundary between the VB process and the Excel process: this adds a lot of overhead, particularly if you are making many calls to
Excel (eg. iterating through large ranges).

Try to redesign your code so it makes as few calls to Excel as possible (eg. read large ranges into a variant array and iterate
through that in VB rather than reading each cell's value from Excel).


--
Tim Williams
Palo Alto, CA


"RB Smissaert" wrote in message ...
Not much chance to know what you are doing wrong without knowing what you
are doing.

RBS

wrote in message
oups.com...
Hi. I was working on a project writing a macro with vba. i finished
writing my macro and decided to use vb to make a stand-alone executable
with numerous forms (as opposed to different excel files) for our
different tools. For some reason, the one tool took about an hour to
run in vba, but it is going much much slower in vb now when I try to
run it. Is this normal? Any ideas what I could be doing wrong to slow
down the process? Thanks!

Nick




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
Runtime Sundowner Excel Discussion (Misc queries) 0 February 27th 10 01:31 AM
XL Runtime error '429' message: a question to Microsoft's experts XL Baby Excel Discussion (Misc queries) 0 August 4th 08 01:28 AM
Runtime Error 9 Lizz45ie Excel Discussion (Misc queries) 1 May 27th 05 08:44 PM
Runtime Error TomD Excel Programming 2 April 30th 04 07:23 PM
VBA Runtime Error Ilan Lowbeer Excel Programming 3 July 21st 03 01:54 AM


All times are GMT +1. The time now is 12:38 PM.

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"