Chat LIVE With Programming Experts! There Are 23 Online Right Now...

Welcome to Dream.In.Code
Become a VB Expert!

Join 244,267 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,176 people online right now. Registration is fast and FREE... Join Now!




Appending data to xlx from vb6

 
Reply to this topicStart new topic

Appending data to xlx from vb6, The code used here opens a new excel file. But I want the text to be a

Pushpitha
28 Sep, 2008 - 12:06 AM
Post #1

New D.I.C Head
*

Joined: 27 Sep, 2008
Posts: 3

vb

Private Sub Command1_Click()
'Copy a string to the clipboard
Dim myData As String
myData = Text2.Text
Clipboard.Clear

Clipboard.SetText myData

'Create a new workbook in Excel
Dim oExcel As Object
Dim oBook As Object
Set oExcel = CreateObject("Excel.Application")
Set oBook = oExcel.Workbooks.Add
'Paste the data
oBook.Worksheets(1).Range("A1").Select
oBook.Worksheets(1).Paste

'Save the Workbook and Quit Excel
oBook.SaveAs "Book1.xlsx"
oExcel.Quit
Text2.Text = ""
End Sub


User is offlineProfile CardPM
+Quote Post


PsychoCoder
RE: Appending Data To Xlx From Vb6
28 Sep, 2008 - 01:03 AM
Post #2

loves.Coding(this);
Group Icon

Joined: 26 Jul, 2007
Posts: 12,282



Thanked: 372 times
Dream Kudos: 10775
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net, jQuery

My Contributions
Are you receiving any errors? Does this code not work that way you intended it? When asking for help there are a couple items that are vital in order for someone to properly help you:

  • Post the code you're having problems with (DONE)
  • Post the exact error you're receiving, if you are receiving one
  • If no error explain what the code is doing versus what you want it to do
  • Post your question in the body of your post, not the description field

User is offlineProfile CardPM
+Quote Post

Pushpitha
RE: Appending Data To Xlx From Vb6
28 Sep, 2008 - 01:20 AM
Post #3

New D.I.C Head
*

Joined: 27 Sep, 2008
Posts: 3

[quote name='Pushpitha' date='28 Sep, 2008 - 01:06 AM' post='425494']
This code opens the xlx file and prints the text for the first time. The second time when the command button is clicked, it opens the file and overwrites the first text. I want the second text to be appended to the (first) existing text.
User is offlineProfile CardPM
+Quote Post

thava
RE: Appending Data To Xlx From Vb6
29 Sep, 2008 - 06:19 PM
Post #4

D.I.C Addict
Group Icon

Joined: 17 Apr, 2007
Posts: 670



Thanked: 35 times
Dream Kudos: 75
My Contributions
try this link you can find the solution for rhis


http://www.dreamincode.net/forums/showtopic65234.htm

This post has been edited by thava: 29 Sep, 2008 - 06:19 PM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 7/4/09 12:45PM

Live VB Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month