如何使用c#访问Excel VBA的立即窗口 [英] How to access Immediate Window of Excel VBA using c#

查看:148
本文介绍了如何使用c#访问Excel VBA的立即窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我打开了一个excel。



现在在我的c#项目中,我需要打开excel VBA的即时窗口并键入一些值。

例如)如果我将MsgBoxHi放在我的c#项目中,它应该打印在我的excel即时窗口中并且还应该执行然后显示Hi弹出窗口。



请帮助我实现它。

Hi,

I am having a excel opened.

Now in my c# project, I need to open the immediate window of excel VBA and type some values.
e.g) If I put MsgBox "Hi" in my c# project, it should be printed in my excel immediate window and also should execute it and display the "Hi" pop-up.

Please help me in achieving it.

推荐答案

按照以下链接:

C#

有没有办法将vba宏代码添加到excel? [ ^ ]

如何使用Visual C#.NET中的自动化创建Excel宏 [ ^ ]

使用C#将vba代码插入现有工作表 [ ^ ]

在C#中运行时创建和运行Excel宏 [ ^ ]



VBA / VB

如何动态添加和运行VBA Visual Basic中的宏 [ ^ ]

使用VBA以编程方式将宏添加到Excel工作簿 [ ^ ]

以编程方式从代码模块添加或删除宏 [ ^ ]

如何以编程方式将代码模块添加到Excel中[ ^ ]



我希望它会有所帮助;)
Follow below links:
C#
Is there a way to add vba macro code to excel?[^]
How To Create an Excel Macro by Using Automation from Visual C# .NET[^]
Insert vba code into existing worksheet using C#[^]
Create And Run Excel Macro At Runtime in C#[^]

VBA/VB
How to dynamically add and run a VBA macro from Visual Basic[^]
Programmatically add macro to Excel Workbook using VBA[^]
Add or Remove a macro from code module programmatically[^]
How to add code module to Excel programmatically[^]

I hope it will be helpful ;)


这篇关于如何使用c#访问Excel VBA的立即窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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