VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VBA Compile error

6 REPLIES 6
Reply
Message 1 of 7
dboskovitch
2542 Views, 6 Replies

VBA Compile error

I have an old macro from 2006 that works on 2013. but when i run it on 2014 i get a compile error.

 

Compile error:

the code in this project must be updated fo ruse on 64-bit systems.

Please review the update Declare statements then mark them with

the PtrSafe attributes.

 

i have no idea what it is trying to tell me

6 REPLIES 6
Message 2 of 7
truss_85
in reply to: dboskovitch

I am only guessing.

Have you change references?

 

if you post your code, I can help more usefully.

Message 3 of 7
dboskovitch
in reply to: truss_85

I have attached a screen shot of the error.
------------------------------

Larry Brinker
Technical Support Engineering
440-945-6330 x134
440-552-0985 mobile
lbrinker@hpcflow.com

Hughes-Primeau Controls, Inc.
Engineered Flow Solutions
www.hpcflow.com


EFFECTIVE 9/16/13
Please update your address book to reflect our new email and web address. Thank you.
Message 4 of 7
truss_85
in reply to: dboskovitch

There is no file attached. Take a look at attached file. I mean check your reference it may be the reason of your problem. it does not matter if I saw error massage or not. You had already wrote error message. But strongly reference problem I guess.

Message 5 of 7

Hello,

 

think we've got simmilar problems. We're running little macro on AutoCAD 2012 which is after switching to AutoCAD 2015 - WIN7 64bit machines not running any longer.

Getting a compile error too.

 

Compile error:

the code in this project must be updated fo ruse on 64-bit systems.

Please review the update Declare statements then mark them with

the PtrSafe attributes.

 


Is there anyone who could help me out getting this trunning on 64bit again?

 

 

 

 

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Beenden As Double        'Variable für Auswertung Programmabbruch / Programmende



Public Sub MenuLoad()
'Modul-Version  06.09.06

On Local Error Resume Next

'Werkzeugkasten "Wood-Tools_2004" laden
Dim MGroup As AcadMenuGroup
Dim MenuFile As String
MenuFile = "C:\Programme\AutoCAD 2004\Wood-Tools\Wood-Tools_ACAD2004_v4-1.mnu"
Set MGroup = Application.MenuGroups.Load(MenuFile)
ThisDrawing.Utility.Prompt "" & vbNewLine & "* WoodTools_2004 erfolgreich geladen *"

'Farbeinstellungen
Application.Preferences.Display.GraphicsWinModelBackgrndColor = 0           'Hintergrundfarbe Schwarz
Application.Preferences.Display.ModelCrosshairColor = RGB(255, 234, 0)      'Fadenkreuzfarbe Gelb
Application.Preferences.Drafting.AutoSnapMarkerColor = acRed                'Farbe der Objektfang-Pickbox Rot

'Start-Dialogfeld einblenden
Startdialog.lbl_Version.Caption = "Version 4.0"
Startdialog.lbl_Datum.Caption = "stand 01.10.2006"
Startdialog.lbl_edition.Caption = "basic - edition"
'Startdialog.lbl_edition.Caption = "professional - edition"
Startdialog.Show

'Logo in ProgressBar
ThisDrawing.SetVariable "MODEMACRO", "Wood-Tools 2004  " & Startdialog.lbl_edition.Caption

End Sub

 

 

 

 

 

Message 6 of 7

That is due to the change of VBA from 32bit (VBA6.x) to 64 bit (VBA7.x), where the declaration of Win "kernal32" must be updated. The "Sleep" declaration should be in 64-bit VBA:

 

Private Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal ms As LongPtr)

 

If you searched the Internet, you would have found a lot links on this topic. Here is one of them that provides exactly the information you need:

 

http://support.microsoft.com/kb/983043

 

HTH

 

 

Message 7 of 7

Thanks for guiding me in the right direction!

 

Just think i`m not able to change what you've discribed or is written in the ms dokument, don't know anything about VBA and think this thing will we hard to get under control even when it's just a quick change to the data.

 

Just a joiner you know..?!

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost