从VB程序控制Excel 2007 [英] Controlling Excel 2007 from VB program

查看:82
本文介绍了从VB程序控制Excel 2007的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在某些情况下,当工作簿处于打开状态(受保护,分组,共享,或窗格和拆分)时,附加到文件的XLA不会运行。

Under certain circumstances, the XLA that is attached to the file does not run when the workbook is open (protected, group, shared, or panes and splits).

我有一个VB6项目(非VBA)。 我正在尝试从我的代码中打开excel,打开工作簿,动态编写宏,然后运行该宏。  我收到错误1004:对象'_Global'的方法'ThisWorkbook'失败。 当这个项目运行时。 
我看到一个"ThisWorkbook"在Microsoft Excel对象部分;但从我能说的是正常的。 那里没有代码。 我很困惑。 

I have a VB6 project (Not VBA).  I'm trying from my code to open excel, open workbook, dynamically write a macro, and then run that macro.  I get an error 1004: Method 'ThisWorkbook' of object '_Global' failed.  When this project runs.  I see a "ThisWorkbook" in the Microsoft Excel Objects section; but from what I can tell that's normal.  There's no code in that.  I'm confused. 

我很感激任何帮助。

推荐答案

请参阅VB 6.0的以下链接(以及之前的问题)。此论坛主要用于Visual Basic .NET。

See the below link for VB 6.0 (and earlier questions). This forum is primarily for Visual Basic .NET.

http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/6a0719fe-14af-47f7-9f51-a8ea2b9c8d6b


这篇关于从VB程序控制Excel 2007的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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