Excel VBA应用程序 - 读卡器 [英] Excel VBA Application - Card Reader

查看:417
本文介绍了Excel VBA应用程序 - 读卡器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当简单的应用程序,只有一个表单。所有代码都包含在Excel工作簿文件和标准VBA模块中。  宏设置设置为启用所有宏。我想允许用户将Excel文件从较低的文件夹
复制到上面的文件夹,打开Excel文件并选择"打开GC表单"。用于添加"记录"的菜单选择到电子表格。我收到一条错误消息"无法运行宏"宏名称"宏可能在此工作簿中不可用..."这是

I have a rather simple application with one form. All the code is contained within the Excel workbook file and in standard VBA Modules.  The Macro Settings are set to Enable All Macros. I want to allow the user to copy the Excel file from a lower folder to the folder above, open the Excel file and select an "Open GC Form" menu selection to add "records" to a spreadsheet. I get an error message "Cannot run the Macro "macro name" The macro may not be available in this workbook..." which it is.

当我在我的开发目录中执行相同的步骤时,它的工作正常。

When I perform the same steps in my development directories it works just fine.

有任何建议吗?

推荐答案

Hi,

如何调用宏VBA应用程序?具体代码是什么?

How do you call the macro in the VBA application? What' s the specific code?

您是否正在调用/运行标准VBA模块中的宏表单?模块和表单是在同一个文件中还是分开? 

Are you calling/running the macro in a standard VBA Module from a form? Are the module and the form in the same file or separated? 

你是什么意思"宏试图打开从原始开发目录",你的意思是在移动文件后调用宏时,它实际上是在原始的
文档中运行宏吗?

What do you mean "the Macro is trying to open from the original development directory", do you mean when calling the macro after you move the file, it actually run the macro in the original document?

无论文件在哪里,我都可以通过使用Application.Run"Book1.xlsm!test"成功运行宏。或调用测试

I could succeed in run the macro no matter where the file is by using Application.Run "Book1.xlsm!test" or Call test

" test"是Module1中的宏名称

"test" is a macro name in the Module1

Sub test()

Sub test()

MsgBox(" test")

MsgBox ("test")

End Sub

你调用宏的步骤是什么?由于我们无法重现您的问题,请与我们分享更多详细信息。

What's your steps to call the macro? Since we couldn’t reproduce your issue, please share more detail information with us.


这篇关于Excel VBA应用程序 - 读卡器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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