本文介绍了VBA慢了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在最初为Word 2003编写的项目中有许多宏。它们都是根据我们的能力进行了优化。我们现在正在尝试在Word 2010中使用相同的宏。通常,它们在Word 2010中执行的时间大约要长5倍。我们认为
大部分放缓都是在搜索过程中发生的。

We have many macros in a project originally written for Word 2003. They are all optimized for speed as far as we are able. We are now trying to use the same macros in Word 2010. Typically they take about 5 times longer to execute in Word 2010. We think that most of the slowing down is happening during searches.

一个典型的宏如下(旨在纠正空格不应该出现的错误,例如,超级).b

A typical macro is as follows (designed to correct errors where a space should not, for example, be superscipt)

查找每个空格,并通过查看空格前后的字符来确定空格是否应为superscipt / subscript。

Find each space and decide, by looking at the characters before and after the space, if the space should be superscipt/subscript or not.

在Word 2003中执行速度非常快,在Word 2010中速度要慢得多。

Executes very fast in Word 2003, very much slower in Word 2010.

我的问题是"为什么在Word 2010中执行的VBA比在Word 2003中执行速度慢"。

My question is "Why is VBA slower to execute in Word 2010 than it is in Word 2003".

推荐答案


这篇关于VBA慢了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 16:11