hi all,
i'm quite new to VB and i want to store my collected data to VB automatically once i press the command button. Till now i only manage to save through the pop up window using the commondialog1. can anyone please help me? may i know how to declare a notepad application in VB like :-
i wrote: NewFile=CreateO bject("Notepad. Application") but come out error saying no active x application.
below is my sample code:
thank you
i'm quite new to VB and i want to store my collected data to VB automatically once i press the command button. Till now i only manage to save through the pop up window using the commondialog1. can anyone please help me? may i know how to declare a notepad application in VB like :-
Newfile=CreateO bject("Excel.Ap plication")
i wrote: NewFile=CreateO bject("Notepad. Application") but come out error saying no active x application.
below is my sample code:
Code:
Dim array_data As String
Dim x As Integer
Dim list_array As Variant
List1.Clear
array_data = "yes"
CommonDialog1.CancelError = True
On Error GoTo CancelButton
CommonDialog1.Filter = "Text files (*.txt|*.txt"
CommonDialog1.ShowSave
Newfile = CommonDialog1.FileName
Open Newfile For Output As #1
If array_data <> "" Then
ReDim Preserve received_data(Text3.Text)
For x = 0 To Text3.Text
received_data(x) = x & "," & array_data
Next x
End If
For Each list_array In received_data
Write #1, list_array
List1.AddItem List1.Text & vbCrLf & list_array
Next
Close #1
CancelButton:
Exit Sub
Comment