以90%缩放打开Excel [英] Open Excel at 90% zoom

查看:47
本文介绍了以90%缩放打开Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我能够从vb.net创建/打开一个Excel ss,但是如何以90%的比例打开它...

ActiveWindow。放大= 90


但我得到Activewindow未声明。我是新手,请帮助

Hello
I was able to create/open an Excel ss from vb.net but how do I open it at 90% something like...
ActiveWindow.Zoom = 90

but I get "Activewindow is not declared." I''m really new at this, please help

推荐答案

虽然Activewindow属性可以在Excel中引用,但是隐含了Application对象,你不能在Excel之外做这件事。您必须完全限定Excel应用程序服务器对象。


使用VBA作为插图

Although the Activewindow property can be referred to on its own from within Excel, where the Application object is implied, you can''t do this outside of Excel. You must fully-qualify the Excel application server object instead.

Using VBA as an illustration

展开 | 选择 | Wrap | 行号


您好 - 感谢您的回复。我尝试了你的建议和

我得到的对象引用没有设置为对象的实例。


我有这个创建ss的过程
Hello - thanks for the reply. I tried your suggestion and
I''m getting "Object reference not set to an instance of an object."

I have this within a procedure that creates the ss
展开 | 选择 | Wrap | 行号


我使用objExcel作为对象变量名的示例。实际上,您已声明了第二个Excel应用程序对象,该对象与您已实例化的名为xlApp的对象完全没有任何关联。更糟糕的是,在objExcel实例中打开工作簿之前,没有可供参考的活动窗口。


现在我知道你声明了哪些对象有多种选择,因为应用程序对象可以从Worksheet对象以及直接获得。在您的情况下,最简单的方法是用上面的第8行和第9行替换

I was using objExcel as an example of an object variable name. You have in effect declared a second Excel application object, which has no connection at all to the object called xlApp you have already instantiated. Even worse, until you open a workbook in the objExcel instance there is no active window to refer to.

Now that I know what objects you have declared there are several choices, as the Application object is available from a Worksheet object as well as directly. Perhaps simplest in your case is to replace lines 8 and 9 above with

展开 | 选择 | Wrap | 行号


这篇关于以90%缩放打开Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆