Link to home
Start Free TrialLog in
Avatar of whatsgoingon66
whatsgoingon66

asked on

output file creating

I am a n00b at vb and I need a vb6.0 to create a log file I have the form pretty together and I got it running evey x minutes with a command button or at a certian time<- I had to make an alarm so I copied that code! My problem is I am not sure how to creat output files in vb6.0 and I need the code also we want to name the text that it creates the time and date cause its going to become a log file of all the users in a computer lab.  Also I don't need the code for this yet but, is it possible to tell VB to open up Excel and use the data in the text file to creat a bunch of graphs and charts...I am still in college and this is my first semester of vb.  They drill us with c++ for 2.5 years.


Thanks for the help,
whatsgoingon
SOLUTION
Avatar of NBrownoh
NBrownoh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bingie
bingie

If you want to log the events you shoud open your file for Append. This will add to the data in the file as oppose to using Output will will overwrite the data.

   Dim FileA
   FileA = FreeFile
   Open "C:\Out.log" For Append As FileA
   Print #FileA, "Hey"
   Close FileA
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of whatsgoingon66

ASKER

ok thanks guys I just have 1 questions I got the file to write and Append fine but its all on 1 line I though this would make another line. txtlog.Text = txtlog.Text + LF + CR  
My teacher really is useless and I need this for my job(where I am just supposed to be a help desk person for office and e-mail) and I am gonna try and get some more points for you guys thanks alot for the excel question. I miss my C++ got endl ? :) thanks again

later,
whatsgoingon
Sure,

You have to use VbCrLF

Print #FileA, "Hey" + VBCrLF

Thanks!
thanks for the points, and thanks to bingie for the help on the file access stuff, im a bit rusty too :)
anytime....
well here is something wierd every time I added the line

CreateChart()
it said Expected =

so I changed
Private Sub CreateChart() to
Private Function CreateChart() As Boolean
CreateChart = true

and then it worked fine and created the chart and everything

anyway just though that was some crazy vb crazyness

anyway thanks alot

I hope I gave enough points to everybody If I didn't I am sorry jsut tell me how much I should give for next time

later,
whatsgoingon
HA!

Nathan, looks like i goofed!

It should read

   Print #FileA, "Hey" & VBCrLF

NOT

   Print #FileA, "Hey" + VBCrLF

Its getting late here...



true true, i only use plus for math stuff anymore, back in the day i used to use it for string manip but liked & better.