FileSaveAs function syntax error
Posted: Wed Jul 07, 2010 3:49 pm
I'm using DDE to control DPlot from Excel, and am trying to save a 3D contour plot I have DPlot generate from Excel data. The problem I have is that when I try to execute the macro it gives me a syntax error in the FileSaveAs command. Apparently it expects the open quotation for the file name to be the terminator for the command. However, as far as I can tell I'm following the definition of the FileSaveAs command per the DPlot manual, and everything BUT the FileSaveAs command works fine. Any idea what I am doing wrong?
Here is the example from the manual:
FileSaveAs(1,"c:\mydata\|TITLE1|.grf")
Here is an excerpt from my macro:
For row = 1 To nrows
DDEExecute Channel, "[XYZEx(0,1," + Str$(Sel.Cells(row, 1)) + "," + Str$(Sel.Cells(row, 2)) + "," + Str$(Sel.Cells(row, 3)) + ")]"
Next row
Application.Wait (Now + TimeValue("0:00:03"))
'Adds a delay before displaying the plot
DDEExecute Channel, "[XYZRegen()][ViewRedraw()]"
'Displays the plot
DDEExecute Channel, "[ContourLevels(41,0,1)]"
'Sets contour levels
DDEExecute Channel, "[FileSaveAs(1,"d:\|TITLE1|.grf")]"
DDETerminate Channel
End Sub
Here is the example from the manual:
FileSaveAs(1,"c:\mydata\|TITLE1|.grf")
Here is an excerpt from my macro:
For row = 1 To nrows
DDEExecute Channel, "[XYZEx(0,1," + Str$(Sel.Cells(row, 1)) + "," + Str$(Sel.Cells(row, 2)) + "," + Str$(Sel.Cells(row, 3)) + ")]"
Next row
Application.Wait (Now + TimeValue("0:00:03"))
'Adds a delay before displaying the plot
DDEExecute Channel, "[XYZRegen()][ViewRedraw()]"
'Displays the plot
DDEExecute Channel, "[ContourLevels(41,0,1)]"
'Sets contour levels
DDEExecute Channel, "[FileSaveAs(1,"d:\|TITLE1|.grf")]"
DDETerminate Channel
End Sub