我正在尝试读取一个excel文件(xlsm具有宏),所有内容似乎都是正确的,但是以某种方式执行代码需要花费很多时间。这是我的代码:
public void playAnimation(Button doneButton, AnimatorEndListener endListener) {
long animDuration = 880;
ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(bottomContentControllers, "alpha", 1f, 0f);
float value = (float)(0 - doneButton.getHeight() - doneButton.getTop());
final ObjectAnimator slideUpDoneButton = ObjectAnimator.ofFloat(doneButton, "translationY",0f, value);
final AnimatorSet animSet = new AnimatorSet();
alphaAnimator.setDuration(animDuration);
slideUpDoneButton.setDuration(animDuration);
animSet.playTogether(alphaAnimator, slideUpDoneButton);
if(endListener != null) {
animSet.addListener(endListener);
}
animSet.start();
}
我也尝试使用OPCPackage,但结果相同。有人可以给我建议,为什么要花很多时间,还有什么可以改善性能的。
答案 0 :(得分:0)
尝试一下:
sub test()
Dim x as long, y as int
'all of your Dims here
Application.ScreenUpdating = False
'
'
'your code here
'
'
Application.ScreenUpdating = True
end sub