从winForm打开Excel文件并运行宏-如何? [英] Open Excel file from winForm and run macro - How?

查看:227
本文介绍了从winForm打开Excel文件并运行宏-如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在寻找打开Excel文件并运行宏的方法.我在Excel中建立巨集,并汇出至Module1.bas
每天早晨,我都会收到不带宏的报告,而我要做的就是将此宏导入到我的excel报告中并运行.现在,我想用C#制作一个小型应用程序,在这里我可以选择报表并对该文件执行宏.

Hi there,

I am looking for way to open excel file and run macro. I build macro in excel and export to Module1.bas
Every morning I receive report without macro inside, and what I do is import this macro to my excel report and run. Now I want to make small application in C# where I can select report and perform macro on that file.

Any idea?

推荐答案

我能想到的唯一方法是使用MS Office自动化工具,但是我没有这样做的经验(而且不要不知道有人这样做-或想这么做). Google是您的朋友.
The only way I can think of doing this is to use the MS Office automation stuff, but I have no experience in doing that (and don''t know anyone that has done it - or wanted to). Google is your friend.


谢谢您,这对您来说是个好开始.
Thank you, that''s good for start.


这篇关于从winForm打开Excel文件并运行宏-如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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