Hi,
I am using msflexgrid control and third party liberary.I am getting data from the net in msflexgrid continously after every one minute. I want to append these data in one of the charting software. I hav two problems.(1). i am getting Type mismatch error(2).If once chart get first tick then in the second minute I get the msg that the following directory already exists.How can I append data and how can I overwrite the already existing file in the directory........Here is mycode...

Dim Writer As New MLWriter
Dim dsymbol, dname As String
Dim i, j, X As Integer
Dim ddate, dtime As Variant
Dim dopen, dhigh, dlow, dclose, dvolume, dopenint As Variant
Dim inrow, inrows, incols, incol As Integer

With MSFlexGrid1
inrows = .RowSel - 1
inrow = .Row
incols = .ColSel - 1
incol = .Col
End With

Do While MSFlexGrid1.ColSel - 1
For i = 1 To inrow
For j = 0 To inrow - 1
Ticker$ = Text1.Text
dsymbol = Ticker$: dname = Ticker$
ddate = MSFlexGrid1.TextMatrix(inrow, 1)
dtime = MSFlexGrid1.TextMatrix(inrow, 2)
dopen = MSFlexGrid1.TextMatrix(inrow, 4)
dhigh = MSFlexGrid1.TextMatrix(inrow, 5)
dlow = MSFlexGrid1.TextMatrix(inrow, 6)
dclose = MSFlexGrid1.TextMatrix(inrow, 7)
dvolume = MSFlexGrid1.TextMatrix(inrow, 8)
dopenint = MSFlexGrid1.TextMatrix(inrow, 9)


Writer.CreateDirectory "D:\MetaStock\Dow"
Writer.AppendIntradaySecurity dsymbol, dname, Tick, 90000, 203000
Writer.AppendDataRec ddate, 0, dopen, dhigh, dlow, dclose, dvolume, dopenint

Next j
Next i
Loop

Kindly help me on this.
Thanks in advance.

I've never had to append before, but to "overwrite" as you say, just delete the file before you re-create it. In VB6 its just

Kill Filename

where Filename is a fully qualified file name.

Hi andy999,
I am not know about WLWriter, but why u give the
1. Writer.CreateDirectory function inside a loop
2. To suppress errors u can use any error handling routine such as
on error goto Label
On error resume next

It may help u think so

ok thanks lrt me try this

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.