ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can VB execute VBA code? (https://www.excelbanter.com/excel-programming/418182-can-vbulletin-execute-vba-code.html)

TomThumb

Can VB execute VBA code?
 
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

DMoney

Can VB execute VBA code?
 
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


Sheeloo[_2_]

Can VB execute VBA code?
 
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


Charles Williams

Can VB execute VBA code?
 
It is very unlikely that compiling your VBA macro using VB6 will make it run
any faster.

The only known exceptions a
- 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" wrote in message
...
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




TomThumb

Can VB execute VBA code?
 
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 a
- 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" wrote in message
...
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






All times are GMT +1. The time now is 05:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com