Help with Drawing Lines Using VB6.0

  • Thread starter Thread starter James Walker
  • Start date Start date
J

James Walker

Hello all,



I have a created a program using VB6.0 that makes an Excel spreadsheet.
Within the spreadsheet, the VB6 program draws lines using coordinates (eg.
Sheet.Shapes.AddLine(122.25, 471#, 132.75, 471#).Line.Weight = 1.5)



For most of the users, this works fine, however I have a few users that have
the lines slightly shifted to the left and down from where they should be.



All users have the same version of VB6 program and same version (with
Service Pack) of Excel. Is there some sort of setting in Excel that the user
can change the coordinate system?



Thanks for any help,

James Walker, Jr.
 
The zoom setting is probably not set to 100%.

this gives me a slightly different location when using your code.

Perhaps you want to anchor to a cell

Sub DrawLine()
With Worksheets("Sheet1").Range("C37")
ActiveSheet.Shapes.AddLine(BeginX:=.Left + 0.5 * .Width, _
BeginY:=.Top + 0.5 * .Height, _
EndX:=.Left + 0.5 * .Width + 12, _
EndY:=.Top + 0.5 * .Height).Line.Weight = 1.5
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top