I have some sample code from MSDN that I am trying to adapt for use but the VBA compiler rejects the contents of the angled brackets < >
. I have the following code in a module:
Imports System
Imports System.Runtime.InteropServices
<DllImport("../../insert_dll_name_here.dll", CallingConvention:=CallingConvention.Cdecl)> _
Public Function Test(file() As String) As Integer
End Function
I am trying to use this code to call a simple function from a C++ dll that expects an array of strings but I get the compile error 'expected line number or label or statement or end of statement' and do not find the help menu provided to be any use. I have tried square brackets [ ]
in case this is a problem of VBA version to no avail. Could someone point out my error in using the COM interop services.