borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (How to print a spreadsheet using VB) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : need help!
Poster Message
chelle_1212
Level: Guest


icon need help!

this might be a very simple question but i really need an answer to it..thanks!

How can I make a report in Visual Basic using the data from a text file? I think I need to convert it to an xls or mdb file right? But how can I use Excel or Access to make a report in VB?

[Edited by chelle_1212 on 28-02-2003 at 01:01 PM GMT]

[Edited by chelle_1212 on 28-02-2003 at 01:04 PM GMT]

28-02-2003 at 02:23 AM
| Quote Reply
JLRodgers
Level: Moderator

Registered: 04-04-2002
Posts: 1616
icon Re: need help!

You forgot to post the question.

____________________________
Everywhere's Local (classifieds, job postings, & more for everycity in the world - user entered)

28-02-2003 at 04:27 AM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: need help!

Just a couple of hints to start from.

Both Excel and Access allow to import data from a text file. You can do it manually by hitting the Import menu voice. By VBA is avaliable the DoCmd object, that can execute every Access/Excel menu command.

So, to run the Import command, you can try this (I did it in Access):


Private Sub btnCommand1_Click()

    DoCmd.RunCommand (acCmdImport)
    ' The acCmdImport inner constant means the Import menu voice.
    
End Sub

After it, you can create a report and view it, by (still in Access):


Private Sub btnCommand2_Click()

    DoCmd.RunCommand (acCmdNewObjectReport)
    ' (acCmdNewObjectReport = Insert|Report menu voice)

End Sub

Only, Im not sure you can create a report in Excel, I never tried it. To simply preview the sheet you must run another command, so the same method but a different inner constant (you can search it).

Hope it helps.



____________________________
Real Programmer can count up to 1024 on his fingers

28-02-2003 at 09:09 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : need help!
Previous Topic (How to print a spreadsheet using VB) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder