DPlot_3DBorder not running from excel vba
Posted: Tue Dec 22, 2015 7:14 am
by Leon
Hi,
I've got excel 2010 with vba 7.0.
I've got the following data in excel
-1.618034 1.90211308 6.236067772
-1 0 1
-0.618034 1.1755705 1.76393199
-0.381965995 1.90211308 3.76393199
0 0.726543069 0.527864873
0 3.077683449 9.472135544
0.381965995 1.90211308 3.76393199
0.618034 1.1755705 1.76393199
1 0 1
1.618034 1.90211308 6.236067772
And the following module
'-----------------------------------------------------------------------------------
'
' DPlot-specific stuff
'
Global Const DPLOT_DDE_VERSION = 4 ' Version 4 structure allows up to 100 data sets per plot, adds a 4th title line,
' and allows up to 200 characters (from 80) for title lines and axis labels
Type DPLOT
version As Long ' version number of this structure
hwnd As Long ' handle of client application window
DataFormat As Long ' XY pairs, DX and Y, etc. See DATA_ constants
MaxCurves As Long ' DataFormat Description
' DATA_XYXY Max. number of curves, <= 20
' DATA_DXY ..
' DATA_XYYY ..
' DATA_3D Number of grid cells in X direction,
' = number of data columns-1
' DATA_3DR not used
' DATA_1D Max. number of groups, <20>1) (CAN be negative and/or > 1,
' but exact placement is then a bit hard to predict)
LegendY As Single ' top coord of legend, again expressed as a ratio
' of plot size
NP(0 To 99) As Long ' actual number of points in each curve/group for
' XY/1D plots; cannot exceed MaxPoints.
LineType(0 To 99) As Long ' line types (see codes below)
SymbolType(0 To 99) As Long ' symbol types (see codes below)
SizeofExtraInfo As Long ' Extra information following X,Y data. No need to
' fill in this member for DPLOTLIB calls
Legend As String * 8080 ' Legend(0->79) is the caption for the legend
' Legend(n*80->n*80+79) is the caption for the n'th curve
' Ideally this would be dimensioned as Legend(0 to 100) as String*80,
' but VBA wants to do weird unicode conversion on the array when
' we do that. Same problem exists for the Label array (next).
' Fortunately we can get around this mess with individual DPlot commands.
label As String * 4000 ' Strings displayed beside the last data point
' in a curve, 40 characters per curve
Title1 As String * 200
Title2 As String * 200
Title3 As String * 200
Title4 As String * 200
XAxis As String * 200 ' X Axis label.
YAxis As String * 200 ' Y Axis label.
End Type
Type DPLOT_PLOTMETRICS
size As Long ' size of this structure, should be filled in by the caller
hll As Long ' horizontal and
vll As Long ' vertical coordinates of the lower left corner of the plot, in pixels
hur As Long ' horizontal and
vur As Long ' vertical coordinates of the upper right corner of the plot, in pixels
xlo As Single ' value of x at the left plot extent
ylo As Single ' value of y at the bottom plot extent
xhi As Single ' value of x at the right plot extent
yhi As Single ' value of z at the top plot extent
End Type
#If VBA7 Then
' DDEML Functions
Declare PtrSafe Function DdeAccessData Lib "user32" (ByVal hData As LongPtr, pcbDataSize As Long) As Long
Declare PtrSafe Function DdeAddData Lib "user32" (ByVal hData As LongPtr, pSrc As Byte, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare PtrSafe Function DdeAddDataDPLOT Lib "user32" Alias "DdeAddData" (ByVal hData As LongPtr, d As DPLOT, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare PtrSafe Function DdeAddDataDbl Lib "user32" Alias "DdeAddData" (ByVal hData As LongPtr, X As Double, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare PtrSafe Function DdeAddDataInt Lib "user32" Alias "DdeAddData" (ByVal hData As LongPtr, X As Long, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare PtrSafe Function DdeAddDataStr Lib "user32" Alias "DdeAddData" (ByVal hData As LongPtr, ByVal str As String, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare PtrSafe Function DdeClientTransaction Lib "user32" (pData As Byte, ByVal cbData As Long, ByVal hConv As LongPtr, ByVal hszItem As LongPtr, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy As Long) As LongPtr
Declare PtrSafe Function DdeClientTransactionHandle Lib "user32" Alias "DdeClientTransaction" (ByVal hData As LongPtr, ByVal cbData As Long, ByVal hConv As LongPtr, ByVal hszItem As LongPtr, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy As Long) As Long
Declare PtrSafe Function DdeClientTransactionReq Lib "user32" Alias "DdeClientTransaction" (ByVal dummy As LongPtr, ByVal cbData As Long, ByVal hConv As LongPtr, ByVal hszItem As LongPtr, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy As Long) As Long
Declare PtrSafe Function DdeClientTransactionStr Lib "user32" Alias "DdeClientTransaction" (ByVal text As String, ByVal cbData As Long, ByVal hConv As LongPtr, ByVal dummy1 As LongPtr, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy2 As Long) As Long
Declare PtrSafe Function DdeConnect Lib "user32" (ByVal idInst As Long, ByVal hszService As LongPtr, ByVal hszTopic As LongPtr, ByVal dummy As Long) As LongPtr
Declare PtrSafe Function DdeCreateDataHandleNoSrc Lib "user32" Alias "DdeCreateDataHandle" (ByVal idInst As Long, ByVal dummy As Long, ByVal cb As Long, ByVal cbOff As Long, ByVal hszItem As LongPtr, ByVal wFmt As Long, ByVal afCmd As Long) As Long
Declare PtrSafe Function DdeCreateStringHandle Lib "user32" Alias "DdeCreateStringHandleA" (ByVal idInst As Long, ByVal psz As String, ByVal iCodePage As Long) As Long
Declare PtrSafe Function DdeDisconnect Lib "user32" (ByVal hConv As LongPtr) As Long
Declare PtrSafe Function DdeFreeDataHandle Lib "user32" (ByVal hData As LongPtr) As Long
Declare PtrSafe Function DdeFreeStringHandle Lib "user32" (ByVal idInst As Long, ByVal hsz As LongPtr) As Long
Declare PtrSafe Function DdeGetLastError Lib "user32" (ByVal idInst As Long) As Long
Declare PtrSafe Function DdeInitialize Lib "user32" Alias "DdeInitializeA" (pidInst As Long, ByVal pfnCallback As LongPtr, ByVal afCmd As Long, ByVal ulRes As Long) As Long
Declare PtrSafe Function DdeUnaccessData Lib "user32" (ByVal hData As LongPtr) As Long
Declare PtrSafe Function DdeUninitialize Lib "user32" (ByVal idInst As Long) As Long
' Registry functions
Declare PtrSafe Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As LongPtr) As Long
Declare PtrSafe Function RegOpenKeyEx Lib "advapi32.dll" Alias _
"RegOpenKeyExA" (ByVal hKey As LongPtr, ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As _
LongPtr) As Long
Declare PtrSafe Function RegQueryValueExString Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As LongPtr, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
As String, lpcbData As Long) As Long
Declare PtrSafe Function RegQueryValueExNULL Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As LongPtr, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
As Long, lpcbData As Long) As Long
Declare PtrSafe Function BringWindowToTop Lib "user32" (ByVal hwnd As LongPtr) As Long
Declare PtrSafe Sub CopyMemoryToStr Lib "kernel32" Alias "RtlMoveMemory" (ByVal Destination As String, ByVal Source As LongPtr, ByVal length As Long)
Declare PtrSafe Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal _
lpApplicationName As String, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As String, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long
Declare PtrSafe Function FindWindowClass Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal dummy As Long) As LongPtr
Declare PtrSafe Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
Declare PtrSafe Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Declare PtrSafe Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long
Declare PtrSafe Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Declare PtrSafe Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As Long) As Long
Declare PtrSafe Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As String) As Long
Declare PtrSafe Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, ByVal Source As Long, ByVal length As Long)
Declare PtrSafe Sub PtrToStr Lib "kernel32" Alias "lstrcpyA" (ByVal RetVal As String, ByVal Ptr As LongPtr)
Declare PtrSafe Function RegisterClipboardFormat Lib "user32" Alias "RegisterClipboardFormatA" (ByVal lpString As String) As Long
Declare PtrSafe Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Declare PtrSafe Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As LongPtr, ByVal wMsg As Long, ByVal wParam As Long, lParam As LongPtr) As Long
Declare PtrSafe Function SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwndOwner As LongPtr, ByVal nFolder As Integer, ppidl As Long) As Long
Declare PtrSafe Function SHGetPathFromIDList Lib "Shell32" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal szPath As String) As Long
Declare PtrSafe Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Declare PtrSafe Function WaitForInputIdle Lib "user32" (ByVal hProcess As LongPtr, ByVal dwMilliseconds As Long) As Long
Declare PtrSafe Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
#Else
' DDEML Functions
Declare Function DdeAccessData Lib "user32" (ByVal hData As Long, pcbDataSize As Long) As Long
Declare Function DdeAddData Lib "user32" (ByVal hData As Long, pSrc As Byte, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare Function DdeAddDataDPLOT Lib "user32" Alias "DdeAddData" (ByVal hData As Long, d As DPLOT, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare Function DdeAddDataDbl Lib "user32" Alias "DdeAddData" (ByVal hData As Long, X As Double, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare Function DdeAddDataInt Lib "user32" Alias "DdeAddData" (ByVal hData As Long, X As Long, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare Function DdeAddDataStr Lib "user32" Alias "DdeAddData" (ByVal hData As Long, ByVal str As String, ByVal cb As Long, ByVal cbOff As Long) As Long
Declare Function DdeClientTransaction Lib "user32" (pData As Byte, ByVal cbData As Long, ByVal hConv As Long, ByVal hszItem As Long, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy As Long) As Long
Declare Function DdeClientTransactionHandle Lib "user32" Alias "DdeClientTransaction" (ByVal hData As Long, ByVal cbData As Long, ByVal hConv As Long, ByVal hszItem As Long, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy As Long) As Long
Declare Function DdeClientTransactionReq Lib "user32" Alias "DdeClientTransaction" (ByVal dummy As Long, ByVal cbData As Long, ByVal hConv As Long, ByVal hszItem As Long, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy As Long) As Long
Declare Function DdeClientTransactionStr Lib "user32" Alias "DdeClientTransaction" (ByVal text As String, ByVal cbData As Long, ByVal hConv As Long, ByVal dummy1 As Long, ByVal wFmt As Long, ByVal wType As Long, ByVal dwTimeout As Long, ByVal dummy2 As Long) As Long
Declare Function DdeConnect Lib "user32" (ByVal idInst As Long, ByVal hszService As Long, ByVal hszTopic As Long, ByVal dummy As Long) As Long
Declare Function DdeCreateDataHandleNoSrc Lib "user32" Alias "DdeCreateDataHandle" (ByVal idInst As Long, ByVal dummy As Long, ByVal cb As Long, ByVal cbOff As Long, ByVal hszItem As Long, ByVal wFmt As Long, ByVal afCmd As Long) As Long
Declare Function DdeCreateStringHandle Lib "user32" Alias "DdeCreateStringHandleA" (ByVal idInst As Long, ByVal psz As String, ByVal iCodePage As Long) As Long
Declare Function DdeDisconnect Lib "user32" (ByVal hConv As Long) As Long
Declare Function DdeFreeDataHandle Lib "user32" (ByVal hData As Long) As Long
Declare Function DdeFreeStringHandle Lib "user32" (ByVal idInst As Long, ByVal hsz As Long) As Long
Declare Function DdeGetLastError Lib "user32" (ByVal idInst As Long) As Long
Declare Function DdeInitialize Lib "user32" Alias "DdeInitializeA" (pidInst As Long, ByVal pfnCallback As Long, ByVal afCmd As Long, ByVal ulRes As Long) As Integer
Declare Function DdeUnaccessData Lib "user32" (ByVal hData As Long) As Long
Declare Function DdeUninitialize Lib "user32" (ByVal idInst As Long) As Long
' Registry functions
Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias _
"RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, _
ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As _
Long) As Long
Declare Function RegQueryValueExString Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
As String, lpcbData As Long) As Long
Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias _
"RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As _
String, ByVal lpReserved As Long, lpType As Long, ByVal lpData _
As Long, lpcbData As Long) As Long
Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As Long) As Long
Declare Sub CopyMemoryToStr Lib "kernel32" Alias "RtlMoveMemory" (ByVal Destination As String, ByVal Source As Long, ByVal length As Long)
Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal _
lpApplicationName As String, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As String, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long
Declare Function FindWindowClass Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal dummy As Long) As Long
Declare Function GetFileVersionInfo Lib "Version.dll" Alias "GetFileVersionInfoA" (ByVal lptstrFilename As String, ByVal dwhandle As Long, ByVal dwlen As Long, lpData As Any) As Long
Declare Function GetFileVersionInfoSize Lib "Version.dll" Alias "GetFileVersionInfoSizeA" (ByVal lptstrFilename As String, lpdwHandle As Long) As Long
Declare Function GetLongPathName Lib "kernel32" Alias "GetLongPathNameA" (ByVal lpszShortPath As String, ByVal lpszLongPath As String, ByVal cchBuffer As Long) As Long
Declare Function GetPrivateProfileInt Lib "kernel32" Alias "GetPrivateProfileIntA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Long, ByVal lpFileName As String) As Long
Declare Function HtmlHelp Lib "hhctrl.ocx" Alias "HtmlHelpA" (ByVal hwnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal dwData As Long) As Long
Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As String) As Long
Declare Sub MoveMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As Any, ByVal Source As Long, ByVal length As Long)
Declare Function RegisterClipboardFormat Lib "user32" Alias "RegisterClipboardFormatA" (ByVal lpString As String) As Long
Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long
Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwndOwner As Long, ByVal nFolder As Integer, ppidl As Long) As Long
Declare Function SHGetPathFromIDList Lib "Shell32" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal szPath As String) As Long
Declare Function VerQueryValue Lib "Version.dll" Alias "VerQueryValueA" (pBlock As Any, ByVal lpSubBlock As String, lplpBuffer As Any, puLen As Long) As Long
Declare Function WaitForInputIdle Lib "user32" (ByVal hProcess As Long, ByVal dwMilliseconds As Long) As Long
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
#End If
Global Const TimeOut = 20000 ' TimeOut value in msec for most Dde transactions
Global Const MAX_ADD = 32768
' XY Scaling codes:
Global Const SCALE_LINEARX_LINEARY = 1
Global Const SCALE_LINEARX_LOGY = 2
Global Const SCALE_LOGX_LINEARY = 3
Global Const SCALE_LOGX_LOGY = 4
Global Const SCALE_TRIPARTITE = 5
Global Const SCALE_LINEARX_PROBABILITY = 6
Global Const SCALE_GRAINSIZE_DIST = 7
Global Const SCALE_POLAR = 8
Global Const SCALE_BARCHART = 9
Global Const SCALE_LOGX_PROBABILITY = 10
Global Const SCALE_PROBX_LINEARY = 11
Global Const SCALE_PROBX_LOGY = 12
Global Const SCALE_PROBX_PROBY = 13
Global Const SCALE_TRIANGLEPLOT = 14
' Unit-specific scaling codes ... combine with above values using OR operator
Global Const UNITS_DEFAULT = 0
Global Const UNITS_TRIPARTITE_INCHES = UNITS_DEFAULT ' X=frequency (Hz) Velocity (Y) in inches/sec
Global Const UNITS_TRIPARTITE_FEET = &H100 ' X=frequency, Y=feet/sec
Global Const UNITS_TRIPARTITE_MILLIMETERS = &H200 ' X=frequency, Y=mm/sec
Global Const UNITS_TRIPARTITE_CENTIMETERS = &H300 ' X=frequency, Y=cm/sec
Global Const UNITS_TRIPARTITE_METERS = &H400 ' X=frequency, Y=meters/sec
Global Const UNITS_TRIPARTITE_TINCHES = &H500 ' X=period (seconds), Velocity in inches/sec
Global Const UNITS_TRIPARTITE_TFEET = &H600 ' X=period, Y=feet/sec
Global Const UNITS_TRIPARTITE_TMM = &H700 ' X=period, Y=millimeters/sec
Global Const UNITS_TRIPARTITE_TCM = &H800 ' X=period, Y=centimeters/sec
Global Const UNITS_TRIPARTITE_TMETERS = &H900 ' X=period, Y=meters/sec
Global Const UNITS_GRAINSIZE_MILLIMETERS = UNITS_DEFAULT ' Grain sizes (X) in mm
Global Const UNITS_GRAINSIZE_INCHES = &H100 ' inches
Global Const UNITS_POLAR_RADIANS = UNITS_DEFAULT ' Rotation (X) in radians
Global Const UNITS_POLAR_DEGREES = &H100 ' degrees
Global Const UNITS_USERDEFINED = &H7F00
' Data organization
Global Const DATA_XYXY = 0 ' One or more sets of X,Y data
Global Const DATA_DXY = 1 ' One or more X,Y curves. Constant spacing in X and same number of points in all curves.
Global Const DATA_XYYY = 2 ' One or more X,Y curves. All curves have the same X values.
Global Const DATA_3D = 3 ' Z values on a rectangular grid
Global Const DATA_3DR = 4 ' Random X,Y,Z values
Global Const DATA_IMAGE = 5 ' Used only by DPlot - there's no way to SEND DPlot an image
Global Const DATA_1D = 6 ' One or more groups of Y values.
Global Const DATA_3DS = 7 ' X,Y,Z scatter plot, multiple data sets allowed.
Global Const DATA_4D = 8 ' 4D surface plot (x,y,z,magnitude)
Global Const DATA_4DS = 9 ' 4D scatter plot
' Line styles:
Global Const LINESTYLE_NONE = 0
Global Const LINESTYLE_SOLID = 1
Global Const LINESTYLE_LONGDASH = 2
Global Const LINESTYLE_DOTTED = 3
Global Const LINESTYLE_DASHDOT = 4
Global Const LINESTYLE_MEDDASH = 5
Global Const LINESTYLE_DASHDOTDOT = 6
' Symbol styles
Global Const SYMBOLSTYLE_NONE = 0
Global Const SYMBOLSTYLE_DOT = 1
Global Const SYMBOLSTYLE_CROSS = 2
Global Const SYMBOLSTYLE_ASTERISK = 3
Global Const SYMBOLSTYLE_X = 4
Global Const SYMBOLSTYLE_SQUARE = 5
Global Const SYMBOLSTYLE_DIAMOND = 6
Global Const SYMBOLSTYLE_TRIANGLE = 7
Global Const SYMBOLSTYLE_OCTAGON = 8
Global Const SYMBOLSTYLE_ITRIANGLE = 9
Global Const SYMBOLSTYLE_HEXAGON = 10
Global Const SYMBOLSTYLE_PENTAGON = 11
Global Const SYMBOLSTYLE_STAR = 12
Global Const SYMBOLSTYLE_FILL = &H100 ' May be combined with other styles
' DPlot Number formats
Global Const NF_DEFAULT = 0
Global Const NF_SCIENTIFIC = 1
Global Const NF_FRACTION = 2
Global Const NF_DOLLARSANDCENTS = 3
Global Const NF_DOLLARS = 4
Global Const NF_TIMEOFDAY = 5
Global Const NF_CALENDAR = 6
Global Const NF_PI = 7
Global Const NF_PI_FRACTION = 8
Global Const NF_MONTH = 9
Global Const NF_DAYOFWEEK = 10
Global Const NF_POWERSOF10 = 11
Global Const NF_NONE = 12
Global Const NF_CALENDAR2 = 13
Global Const NF_HEXADECIMAL = 14
Global Const NF_PERCENT = 15
Global Const NF_DEGS_MINS = 16
Global Const NF_DEGS_MINS_SECS = 17
Global Const NF_ENGINEER = 18
Global Const NF_HHMMSS = 19
Global Const NF_TIMEOFDAY2 = 20
Declare Function DPlot_3DBorder Lib "user32" (ByVal DocNum As Long, ByVal NumPoints As Long, ByRef Border As Double) As Long
Sub doborder()
Dim Border(0 To 2, 0 To 1) As Double
Dim doc, ret As Long
Sheets(1).Range("a1:c10").Select
Call XYZSurface
doc = DPlotGetActiveDocument()
ret = DPlot_3DBorder(doc, 3, Border)
End Sub
'-----------------------------------------------------------------------------------
And when I execute the sub function doborder Dplot shows the pentagone but not the star and returns the Compile error: ByRef argument type mismatch
If I change "user32" by "DPlotLib" Excel cannot find it
In dplotlib.xla there is no trace of DPlot_3DBorder
I have DPlot Version 2.3.5.4
Could you please help me?
Many thanks
Leon.