Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error When Making Call

Status
Not open for further replies.

scking

Programmer
Jan 8, 2001
1,263
US
I've built a .dll from .NET using the System.IO.FileInfo namespace that builds a solution but, when called from VBA, generates and exception. It's a very simple class but has me blocked. If anyone could provide me an answer I would appreciate it.

Request for the permission of type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.

Public Class Class1
<ComClass(Class1.ClassId, Class1.InterfaceId, Class1.EventsId)> Public Class Class1

Public Const ClassId As String = "B9E2B29C-62B6-4b2c-B4A2-3D1597B76A0F"
Public Const InterfaceId As String = "8B8332ED-6A57-45fd-A301-D60DA372351B"
Public Const EventsId As String = "9CFE452E-BAD3-49b6-B5E6-2FBADEEC0E8F"

Public Function FileExists(ByVal Filename As String) As Boolean

Dim objFileinfo As System.IO.FileInfo
Dim strFilename As String = Filename

objFileinfo = New System.IO.FileInfo(strFilename)
If objFileinfo.Exists Then
Return True
Else
Return False
End If
End Function
End Class
End Class

---------------------
scking@arinc.com
---------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top