I am attempting to use the methods described in Rod Stephens "Visual Basic Graphics Programming" (2nd edition) in VBA with Excel. I'm hoping to be able to add a graphics window to a workbook that shows the relative position and orientation a couple of rectangles that represent two colliding vehicles. The position and orientation are based on data listed on Sheet1 of an Excel workbook.
I created a new module in the VB Editor and borrowed some simple code from the book that draws a rectangle using the Line command after changing the scale using the ScaleX and ScaleY commands. VBA did not like the scale commands but did not seem to mind the Line command.
The code I used:
'wid = ScaleX(5, vbPixels, ScaleMode)
'hgt = ScaleY(5, vbPixels, ScaleMode)
wid = 50
hgt = 50
Line (10, 10)-Step(wid, hgt), vbRed, BF
So I commented out the scale commands and filled numbers directly in the Line command. The code executes successfully (at least no errors) but I never get a window that opens up to display the rectangle.
I'm using Excel 2003 on a Vista machine.
Am I missing something in the availability of the VB commands in the VBA/Excel environment? Shouldn't I have all VB available to me?
Is this so simple that I'm really missing the boat on this? I am a novice at the graphics part of the VBA development, but have done a bit of programming in VBA.
I created a new module in the VB Editor and borrowed some simple code from the book that draws a rectangle using the Line command after changing the scale using the ScaleX and ScaleY commands. VBA did not like the scale commands but did not seem to mind the Line command.
The code I used:
'wid = ScaleX(5, vbPixels, ScaleMode)
'hgt = ScaleY(5, vbPixels, ScaleMode)
wid = 50
hgt = 50
Line (10, 10)-Step(wid, hgt), vbRed, BF
So I commented out the scale commands and filled numbers directly in the Line command. The code executes successfully (at least no errors) but I never get a window that opens up to display the rectangle.
I'm using Excel 2003 on a Vista machine.
Am I missing something in the availability of the VB commands in the VBA/Excel environment? Shouldn't I have all VB available to me?
Is this so simple that I'm really missing the boat on this? I am a novice at the graphics part of the VBA development, but have done a bit of programming in VBA.