vbaexcelexcel-2010office-2010

AppActivate works in Excel 2007 but not in 2010


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.

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

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

However,

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

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

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

Any help would be really appreciated.

Dim appName as String 

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

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

Solution

  • 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.

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

    Thanks for your time.

    Regards