I have programmed in VBA before, but usually when I make a mistake, I am told exactly what is wrong, or at least where it is. So now that I am trying to add the "Aussie Auto Tool Zero" code with a copper plate, I am lost.

The thread I am talking about is here: http://www.cnczone.com/forums/showthread.php?t=36099

I have added the copper plate, and verified that it is working through the diagnostics screen.

I edited the standard screen to include an LED and a user DRO for the plate thickness input.

I then simply copied and pasted the code into the already present auto tool zero button.

Here is the code I used:

CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO

If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G31Z-20 F100" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
Code "G0 Z20" 'put the Z retract height you want here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Exit Sub
End If

I know I will have to change the distances and the feedrates, but I haven't even gotten it to move at all. As soon as I click on the button, it comes up with a syntax error.

Am I missing something else that needs editted in the screen? Or am I missing something even more basic?

Let me know if you need any more information, I am not sure what else someone may need to diagnose the problem, or point me in the right direction.