Message 1 of 2
2004 VBA not working in 2009
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey Guys,
I have a VBA that was orginally written in LDD 2004, the problem is when I try to run it in LDC 2009 it will not work.
When you try to run this all you get is "Land Desktop not Initialized - Initialize before continuing".
I understand that the structure has changed and the VBA needs to be updated to relect this. But being new to LDC 2009 I am not sure what the right coding is to change this to work.
I have attached the code for "one" of the modules and was hoping soemone could tell me what needs to be changed. I believe it has to do with the call to "AeccDatabasePreferences". I believe "Aecc" is not the call for in LDC 2009, but again being new to LDC 2009 I am not sure what it is now.
******Start Module Code**********
Public Function GetHScale() As Double
'Returns horizontal scale
On Error GoTo ErrHandling
Dim dbPref As AeccDatabasePreferences
Set dbPref = AeccApplication.ActiveDocument.Preferences
GetHScale = dbPref.DatabaseScale
GoTo GetOut
ErrHandling:
MsgBox "Land Desktop not Initialized - Initialize before continuing"
End
GetOut:
End Function
_____________________________________________________________
Public Function GetVScale() As Double
' Returns vertical scale
On Error GoTo ErrHandling
Dim dbPref As AeccDatabasePreferences
Set dbPref = AeccApplication.ActiveDocument.Preferences
GetVScale = dbPref.VerticalScale
GoTo GetOut
ErrHandling:
MsgBox "Land Desktop not Initialized - Initialize before continuing"
End
GetOut:
End Function
______________________________________________________________
Function Report_DatabaseScale()
Dim dbPref As AeccDatabasePreferences
Set dbPref = AeccApplication.ActiveDocument.Preferences
MsgBox (dbPref.DatabaseScale)
End Function
______________________________________________________________
Function WCStoUCSPoint(InPoint As Variant) As Variant
WCStoUCSPoint = ThisDrawing.Utility.TranslateCoordinates(InPoint, acWorld, acUCS, False)
End Function
******End Module Code**********
Thanks in advance!!!
I have a VBA that was orginally written in LDD 2004, the problem is when I try to run it in LDC 2009 it will not work.
When you try to run this all you get is "Land Desktop not Initialized - Initialize before continuing".
I understand that the structure has changed and the VBA needs to be updated to relect this. But being new to LDC 2009 I am not sure what the right coding is to change this to work.
I have attached the code for "one" of the modules and was hoping soemone could tell me what needs to be changed. I believe it has to do with the call to "AeccDatabasePreferences". I believe "Aecc" is not the call for in LDC 2009, but again being new to LDC 2009 I am not sure what it is now.
******Start Module Code**********
Public Function GetHScale() As Double
'Returns horizontal scale
On Error GoTo ErrHandling
Dim dbPref As AeccDatabasePreferences
Set dbPref = AeccApplication.ActiveDocument.Preferences
GetHScale = dbPref.DatabaseScale
GoTo GetOut
ErrHandling:
MsgBox "Land Desktop not Initialized - Initialize before continuing"
End
GetOut:
End Function
_____________________________________________________________
Public Function GetVScale() As Double
' Returns vertical scale
On Error GoTo ErrHandling
Dim dbPref As AeccDatabasePreferences
Set dbPref = AeccApplication.ActiveDocument.Preferences
GetVScale = dbPref.VerticalScale
GoTo GetOut
ErrHandling:
MsgBox "Land Desktop not Initialized - Initialize before continuing"
End
GetOut:
End Function
______________________________________________________________
Function Report_DatabaseScale()
Dim dbPref As AeccDatabasePreferences
Set dbPref = AeccApplication.ActiveDocument.Preferences
MsgBox (dbPref.DatabaseScale)
End Function
______________________________________________________________
Function WCStoUCSPoint(InPoint As Variant) As Variant
WCStoUCSPoint = ThisDrawing.Utility.TranslateCoordinates(InPoint, acWorld, acUCS, False)
End Function
******End Module Code**********
Thanks in advance!!!