Hi Sebastian,
Firstly thanks for such a great product. We have multiple versions of MS Office and NetOffice just makes implementation into this type of environment easy.
I have a strange error with DAOApi.Property. When the DAOApi.Properties(i) is assigned to a DAOApi.Property variable the following error occurs:
Class not exists: NetOffice.ExcelApi.Property
My Dev machine is Win7 Pro 64 with Office 2010 32 bit.
I much appreciate your assistance with this matter.
Cheers,
Gordon
The Method Code follows:
Private Function HasFieldProperty(ByRef checkField As Field,
Firstly thanks for such a great product. We have multiple versions of MS Office and NetOffice just makes implementation into this type of environment easy.
I have a strange error with DAOApi.Property. When the DAOApi.Properties(i) is assigned to a DAOApi.Property variable the following error occurs:
Class not exists: NetOffice.ExcelApi.Property
My Dev machine is Win7 Pro 64 with Office 2010 32 bit.
I much appreciate your assistance with this matter.
Cheers,
Gordon
The Method Code follows:
Private Function HasFieldProperty(ByRef checkField As Field,
ByVal checkPropertyName As String) As Boolean
' Determine if the fieldToCheck has the 'Property Name' (eg: Format, Input Mask,....)
Dim fldName = checkField.Name
' Check if PropertyName Exists
Dim propertyExists As Boolean = False
Dim fldProperty As NetOffice.DAOApi.Property = Nothing
Dim fldProperties As NetOffice.DAOApi.Properties = Nothing
Try
fldProperties = checkField.Properties
For i As Integer = 0 To fldProperties.Count - 1
Dim fldPropertyName = fldProperties(i).Name ' Fails on this line
If fldPropertyName = checkPropertyName.ToUpper Then
propertyExists = True
Exit For
End If
Next i
DisposeObjects: ' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Catch ex As Exception
Dim msg = innerExceptionMessage(ex)
propertyExists = False
Finally
' DisposeObjects (in Reverse Order)
If Not IsNothing(fldProperty) AndAlso Not fldProperty.IsDisposed Then
fldProperty.Dispose()
End If
If Not IsNothing(fldProperties) AndAlso Not fldProperties.IsDisposed Then
fldProperties.Dispose()
End If
End Try
Return propertyExists
End Function