PC Review


Reply
Thread Tools Rate Thread

Can VB execute VBA code?

 
 
TomThumb
Guest
Posts: n/a
 
      7th Oct 2008
My VBA macro runs slowly in Excel 2007. Will Visual Basic compile my VBA
macro into a faster application that I can somehow use with my Excel
spreadsheet?
--
TomThumb
 
Reply With Quote
 
 
 
 
dmoney
Guest
Posts: n/a
 
      7th Oct 2008
yes - with slight code changes -- you will have to reference the excel object
from within vb.

"TomThumb" wrote:

> My VBA macro runs slowly in Excel 2007. Will Visual Basic compile my VBA
> macro into a faster application that I can somehow use with my Excel
> spreadsheet?
> --
> TomThumb

 
Reply With Quote
 
Sheeloo
Guest
Posts: n/a
 
      7th Oct 2008
VBA is a subset of VB... you can run Excel code but will it be faster? First
try to see why your code is slow... then if you find that it is slow because
it runs in Excel then move to VB...

You may send the file to me if it does not contain confidential information
so that I can take a look.
"TomThumb" wrote:

> My VBA macro runs slowly in Excel 2007. Will Visual Basic compile my VBA
> macro into a faster application that I can somehow use with my Excel
> spreadsheet?
> --
> TomThumb

 
Reply With Quote
 
Charles Williams
Guest
Posts: n/a
 
      7th Oct 2008
It is very unlikely that compiling your VBA macro using VB6 will make it run
any faster.

The only known exceptions are:
- using a large number (1000s) of VBA UDFs (bypassable in Manual Mode)
- very intensive arithmetic (eg iteratively solving partial differential
equations)

Make sure you have:
- switched off the Google Office COM Addins
- used Application.Screenupdating=False
- switched to manual calculation mode
- cleaned up your code to eliminate selecting ranges
- transferred data between Excel and VBA in large blocks using variant
arrays

regards
Charles
__________________________________________________
The Excel Calculation Site
http://www.decisionmodels.com

"TomThumb" <(E-Mail Removed)> wrote in message
news:EBF71729-B2E0-437C-9227-(E-Mail Removed)...
> My VBA macro runs slowly in Excel 2007. Will Visual Basic compile my VBA
> macro into a faster application that I can somehow use with my Excel
> spreadsheet?
> --
> TomThumb



 
Reply With Quote
 
TomThumb
Guest
Posts: n/a
 
      7th Oct 2008
Since there seems to be disagreement as to a speed advantage for VB over VBA,
I will try manual calculation mode as a cheap fix. Thanks to you all (3).
--
TomThumb


"Charles Williams" wrote:

> It is very unlikely that compiling your VBA macro using VB6 will make it run
> any faster.
>
> The only known exceptions are:
> - using a large number (1000s) of VBA UDFs (bypassable in Manual Mode)
> - very intensive arithmetic (eg iteratively solving partial differential
> equations)
>
> Make sure you have:
> - switched off the Google Office COM Addins
> - used Application.Screenupdating=False
> - switched to manual calculation mode
> - cleaned up your code to eliminate selecting ranges
> - transferred data between Excel and VBA in large blocks using variant
> arrays
>
> regards
> Charles
> __________________________________________________
> The Excel Calculation Site
> http://www.decisionmodels.com
>
> "TomThumb" <(E-Mail Removed)> wrote in message
> news:EBF71729-B2E0-437C-9227-(E-Mail Removed)...
> > My VBA macro runs slowly in Excel 2007. Will Visual Basic compile my VBA
> > macro into a faster application that I can somehow use with my Excel
> > spreadsheet?
> > --
> > TomThumb

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Don't want this code to execute Robert Bravery Microsoft C# .NET 1 18th Jun 2008 09:39 AM
Execute code from book1 of code from book2 =?Utf-8?B?Umljaw==?= Microsoft Excel Programming 4 5th Jun 2007 05:19 PM
OnTime code error "can't execute code in break mode" tskogstrom Microsoft Excel Programming 1 8th Sep 2006 10:29 AM
How to Execute Code Behind Code in Inline aspx Kamal Ahmed Microsoft ASP .NET 1 25th Oct 2005 09:09 AM
How to add a column to a table using code or execute a scripit using code? RC Microsoft Access Form Coding 6 28th Jun 2004 09:24 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:28 PM.