简体   繁体   English

似乎无法在运行Parallels的Mac上打开Excel for Excel

[英]Can't seem to be able to open DLL for Excel on Mac running Parallels

My main stationary machine is a Windows box running Win 8.1 64-bit and Office 2013 32-bit. 我的主要固定机器是运行Win 8.1 64位和Office 2013 32位的Windows机器。 I developed a 32-bit DLL with functions in VS2013 which I include through Excel VBA. 我开发了一个带有VS2013功能的32位DLL,我通过Excel VBA包含它。 Functions work fine on Windows. 功能在Windows上运行正常。

Then I have a Macbook Pro running Windows 8.1 64-bit and Office 2010 32-bit under Parallels 8. I do not seem to be able to work with the functions from my DLL under this Mac. 然后我在Parallels 8下运行Windows 8.1 64位和Office 32 32位Macbook Pro。我似乎无法使用此Mac下的DLL中的函数。

How I tried: 我怎么试过:

  • Copied my DLL file to a new folder C:\\MyTools under Parallels. 将我的DLL文件复制到Parallels下的新文件夹C:\\MyTools
  • Referenced this folder when loading the DLL in VBA. 在VBA中加载DLL时引用此文件夹。 My VBA code to load a function from the DLL looks like this 从DLL加载函数的我的VBA代码如下所示

    Declare Function MyDLLfunction Lib "C:\\MyTools\\MyDLL.dll" (ByVal s As Double) As Double

  • I also tried double slashes \\\\ to no avail 我也试过双斜线\\\\无济于事

The undesired result when using this function from my worksheet on Parallels is that there's an error code displayed in the cell (#VALUE). 从我在Parallels上的工作表中使用此功能时出现的不良结果是单元格中显示错误代码(#VALUE)。

Is it rather Excel 2010 not being compatible with DLLs in general (can't believe that), or is a matter of referencing the path with the DLL correctly on the Mac? 是不是Excel 2010与一般的DLL兼容(不能相信),或者是在Mac上正确引用DLL的路径? I thought C:\\MyTools\\MyDLL.dll would work as this is how I see the file in the tree of Windows explorer in Parallels. 我认为C:\\MyTools\\MyDLL.dll可以工作,因为这是我在Parallels的Windows资源管理器树中看到的文件。 Or is my Parallels 8 too outdated? 或者我的Parallels 8太过时了?

This is a shot in the dark, but it could be that your DLL is not compiled as a static library and hence there are certain dependencies which are present on your development computer (because of the Visual Studio installation) which are not there on the test computer/in the parallels environment. 这是一个黑暗的镜头,但可能是你的DLL没有编译为静态库,因此你的开发计算机上存在某些依赖项(因为Visual Studio安装),测试中没有电脑/在平行环境中。

Try running your DLL on Excel on an identical Windows system with no visual studio installed. 尝试在没有安装Visual Studio的相同Windows系统上在Excel上运行DLL。 If it doesn't work, the problem is likely to be as mentioned above. 如果它不起作用,问题很可能如上所述。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM