AppActivate在Excel 2007中有效,但在2010年中无效 [英] AppActivate works in Excel 2007 but not in 2010

查看:455
本文介绍了AppActivate在Excel 2007中有效,但在2010年中无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在Excel 2007中运行的excel宏,它打开了一个大型机应用程序,因此我可以自动从电子表格中导入数据.

I have a excel macro that I run in Excel 2007 and it opens a mainframe application so I can import data from my spreadsheet automatically.

这一直很好,但是在Excel 2010中不起作用.

This has been working fine, however it doesn't work in Excel 2010.

我尝试使用shell命令来使用ID,但是另一个应用程序是大型机应用程序,而不是基于Windows的应用程序.

I have tried using the shell command to use the ID but the other application is a mainframe application and non windows based.

但是

AppActivate标题"(打开大型机应用程序)在excel 2007中运行良好.

AppActivate "Title" (to open the mainframe application) was working fine in excel 2007.

在Excel 2010中,我收到运行时错误5-无效的过程调用或参数.

In Excel 2010 I am getting a Run-time error 5 - Invalid procedure call or argument.

我已经尝试解决了两天,并且在2007版本上都可以正常工作.

I've been trying to solve this for two days and it all works fine on 2007 version.

任何帮助将不胜感激.

将appName设置为字符串

Dim appName as String

appName = Range("AppName").Value'这是存储在我的excel电子表格中的大型机应用程序的名称

appName = Range("AppName").Value 'this is a name stored in my excel spreadsheet for the mainframe app

AppActivate(appName)=>此行给出运行时错误"5",无效的过程调用或参数

AppActivate (appName) => this line is giving runtime error '5' invalid procedure call or argument

推荐答案

感谢您的回答,后来我才发现我的用户正在从远程位置启动Excel 2016版本,因此他们尝试打开的应用程序可以显然找不到. Excel的早期版本是从其桌面启动的,因此可以正常工作.

Thanks for the answers, I only found out later that my users were launching the Excel 2016 version from a remote location, so the application they were trying to open could obviously not be found. The previous version of Excel was launched from their desktop so it worked.

简而言之,AppActivate函数对于两个Excel版本都可以正常工作.

In a nutshell, the AppActivate function works fine for both Excel version.

感谢您的时间.

致谢

这篇关于AppActivate在Excel 2007中有效,但在2010年中无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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