Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Addpolyline function
Hi,
I got some problems on addpolyline function Sub test() Dim a(1 To 4, 1 To 2) As Single Dim i As Integer, j As Integer For i = 1 To 4 a(i, 1) = i * 100 a(i, 2) = (i * i) * 100 Next i ActiveSheet.Shapes.AddPolyline a End Sub I got runtime error 1004 if I changed the line "Dim a(1 To 4, 1 To 2) As Single" to "Dim a(1 To 4, 1 To 2) As Variant". Is it a bug? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Addpolyline function
And why do you want to have that array as Variant() ? When you create the
array as variant, the coordinates are dimmed as integer, which might be why the AddPolyline code fails. -- Regards, Juan Pablo González "equiangular" wrote in message ... Hi, I got some problems on addpolyline function Sub test() Dim a(1 To 4, 1 To 2) As Single Dim i As Integer, j As Integer For i = 1 To 4 a(i, 1) = i * 100 a(i, 2) = (i * i) * 100 Next i ActiveSheet.Shapes.AddPolyline a End Sub I got runtime error 1004 if I changed the line "Dim a(1 To 4, 1 To 2) As Single" to "Dim a(1 To 4, 1 To 2) As Variant". Is it a bug? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Addpolyline function
How about if I use double?
The code also fails. The main point is VB should be able to convert variable types on the fly unless the conversion is not compatible Juan Pablo González wrote: And why do you want to have that array as Variant() ? When you create the array as variant, the coordinates are dimmed as integer, which might be why the AddPolyline code fails. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
Need to open the Function Arguments window from VBA for a user defined function. | Excel Programming | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |