DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing Excel Cell Values into DPlot

 
Post new topic   Reply to topic    DPlot Forum Index -> Excel
View previous topic :: View next topic  
Author Message
rholt



Joined: 06 Jul 2014
Posts: 4

PostPosted: Mon Jul 07, 2014 11:07 pm    Post subject: Passing Excel Cell Values into DPlot Reply with quote

Can anyone help me out?

I'm trying to pass dates stored in cells in excel into X,YLabels in DPlot.

I need some help determining the correct VBA syntax to do this?

My code is currently constructed in Excel VBA as

Dim AKDate As Date
AKDate = CDate(Range("B20").value)
Dim WMSDate As Date
WMSDate = CDate(Range("B21").value)
Dim WAEDate As Date
WAEDate = CDate(Range("B22").value)
Dim VTIDate As Date
VTIDate = CDate(Range("B23").value)

' Applying Document Control Dates
ret = DPlot_Command(doc, "[XYLabel(1380,2,0,""AK Run Date"")]")
ret = DPlot_Command(doc, "[XYLabel(1350,2,0, Arrow AKDate)]") ' AK Run Date
ret = DPlot_Command(doc, "[XYLabel(1320,2,0,""WMS Date"")]")
ret = DPlot_Command(doc, "[XYLabel(1290,2,0, Arrow WMSDate)]") ' WMS Date
ret = DPlot_Command(doc, "[XYLabel(1260,2,0,""WAE Date"")]")
ret = DPlot_Command(doc, "[XYLabel(1230,2,0, Arrow WAEDate)]") ' WAE Date
ret = DPlot_Command(doc, "[XYLabel(1200,2,0,""VTI Date"")]")
ret = DPlot_Command(doc, "[XYLabel(1170,2,0, Arrow VTIDate)]") ' VTI Date


Similarly, is there any way to force these XYLabels into DPlot with formatting applied, I need all dates to have red text.


Any help would be greatly appreciated.

Regards,

Ryan.
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2290
Location: Vicksburg, Mississippi

PostPosted: Tue Jul 08, 2014 8:58 am    Post subject: Reply with quote

Use, for example,

Code:
ret = DPlot_Command(doc, "[XYLabel(1350,2,0,""" & AKDate & """)]")


XYLabel text uses the same font (and color) as the numbers along the axes. To use a different color you'll need to embed it in the label, as in:

Code:
ret = DPlot_Command(doc, "[XYLabel(1350,2,0,""" & "{\c0000ff" & AKDate & "}" & """)]")

_________________
David Hyde
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Excel All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group