excel中 Application.Run("SUM", Range("D1:D10")) 运行报错了
时间: 2023-07-10 11:42:54
浏览: 69
这个问题很可能是因为你在调用SUM[函数](https://geek.csdn.net/educolumn/ba94496e6cfa8630df5d047358ad9719?dp_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDQ0MDg2MiwiZXhwIjoxNzA3MzcxOTM4LCJpYXQiOjE3MDY3NjcxMzgsInVzZXJuYW1lIjoid2VpeGluXzY4NjQ1NjQ1In0.RrTYEnMNYPC7AQdoij4SBb0kKEgHoyvF-bZOG2eGQvc&spm=1055.2569.3001.10083)时使用了错误的参数格式。在VBA中,SUM[函数](https://geek.csdn.net/educolumn/ba94496e6cfa8630df5d047358ad9719?dp_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDQ0MDg2MiwiZXhwIjoxNzA3MzcxOTM4LCJpYXQiOjE3MDY3NjcxMzgsInVzZXJuYW1lIjoid2VpeGluXzY4NjQ1NjQ1In0.RrTYEnMNYPC7AQdoij4SBb0kKEgHoyvF-bZOG2eGQvc&spm=1055.2569.3001.10083)的参数应该是一个范围对象。你可以尝试修改代码,将SUM[函数](https://geek.csdn.net/educolumn/ba94496e6cfa8630df5d047358ad9719?dp_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDQ0MDg2MiwiZXhwIjoxNzA3MzcxOTM4LCJpYXQiOjE3MDY3NjcxMzgsInVzZXJuYW1lIjoid2VpeGluXzY4NjQ1NjQ1In0.RrTYEnMNYPC7AQdoij4SBb0kKEgHoyvF-bZOG2eGQvc&spm=1055.2569.3001.10083)的参数改为Range对象,例如:
Application.Run("SUM", Range("D1:D10"))
Application.Run("SUM", Range("D1:D10").Address)
Application.Run("SUM", Range("D1:D10").Value)
这样应该可以[解决](https://geek.csdn.net/educolumn/03368addd5d267af1b4c6df01bb4af26?spm=1055.2569.3001.10083)这个问题。如果还有其他问题,请提供更多的信息,我会尽力帮助你[解决](https://geek.csdn.net/educolumn/03368addd5d267af1b4c6df01bb4af26?spm=1055.2569.3001.10083)。
相关问题
application.Run excel的系统函数报错
如果你使用`Application.Run`函数调用Excel的系统函数时出现错误,可能是以下原因之一:
1. 函数名称拼写错误:请确认你输入的函数名称是否正确,比如SUM函数的拼写是否为"S-U-M",而不是"S-U-M-M"等。
2. 函数参数错误:请确认你传递给Excel系统函数的参数是否正确。Excel系统函数可能需要特定的参数类型或参数格式,如果传递的参数不符合要求,会导致函数调用失败。
3. Excel版本不兼容:请确认你使用的Excel版本是否支持调用指定的系统函数。有些Excel函数可能只在特定的Excel版本中可用,如果你的Excel版本不支持该函数,会导致函数调用失败。
4. Excel设置不兼容:有些Excel设置可能会影响系统函数的运行。比如,如果你的Excel设置中禁用了宏,可能会导致`Application.Run`函数无法调用Excel系统函数。
excel Application.Run 可以调用excel自带的系统函数么
相关推荐















