10 Replies - 2786 Views - Last Post: 28 September 2014 - 07:11 PM Rate Topic: -----

#1 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

transfering data from textbox of vb6 to the cells of excel

Posted 11 September 2014 - 08:35 PM

Good day,

Hi I have a project I need to used excel 2007 as a database but I dont know how to connect vb 6.0 to my existing excel file and also im going to use a textbox to transfer my data to excel. Another thing is I have 50+ rows and columns. please help. Im just new in vb6. any help will be highly appreciaeted. thankss guys.


ice
Is This A Good Question/Topic? 0
  • +

Replies To: transfering data from textbox of vb6 to the cells of excel

#2 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6377
  • View blog
  • Posts: 25,768
  • Joined: 12-December 12

Re: transfering data from textbox of vb6 to the cells of excel

Posted 12 September 2014 - 01:27 AM

DIC has a number of Visual Basic Tutorials. Here's one:

Using Excel with Visual Basic 6!

It is also possible to build an application within Excel, using Worksheets and/or UserForms and VBA.




Why are you starting with VB6, whose last release was in 1998, 16 years ago!
Was This Post Helpful? 0
  • +
  • -

#3 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 12 September 2014 - 03:01 AM

thank for your reply andrew and thank you for those tutorials. im just an intern and they want me to work with vb 6.0 thats the reason why. uhm I will try those tutorials that you gave. thanks guys...
Was This Post Helpful? 0
  • +
  • -

#4 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 14 September 2014 - 10:43 PM

Im having problem in inserting the data through textbox because I have lots of cells and I dont know how to declare the path to those cells.
Was This Post Helpful? 0
  • +
  • -

#5 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 15 September 2014 - 07:41 PM

anyone please I badly need your help.
Private Sub cmdupdate_Click()
Set oApp = excel.Application
Set oWB = excel.Workbooks
Set excelWS = excel.Worksheets 'error mismatch
oApp.Visible = True
excelWS = excel.Workbooks
excelWS = excel.Workbooks.Add
excelWS = excel.Worksheets
excelWS = ("Sheet1")

in the project that Im dong right now that is the error.
help please..... :helpsmilie: :helpsmilie: :helpsmilie:
Was This Post Helpful? 0
  • +
  • -

#6 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 16 September 2014 - 01:31 AM

anyone please ????? :online2long: :sweatdrop: :innocent: :sadlike:
Was This Post Helpful? 0
  • +
  • -

#7 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 16 September 2014 - 09:29 PM

Hi guys Im having a problem in my project and I cant find any solution in the internet thats why i am hopeful that in this forum somebody will help me.
this is my codes
Private Sub cmdupdate_Click()
Set oapp = Excel.Application
Set oWB = oapp.Workbooks.Add
Set excelWS = Excel.Worksheets("Sheet1")
NewRow = range("A").End(xlDown).Offset(1, 0).Row
oapp.Sheets("Sheet4").Cells(NewRow, 1).Value = txtclient.Text
oWB.SaveAs ("C:\140410.xlsx") ' <-- method or data member not found.


and it highlighted the word .saveas
should i declare it or what? :helpsmilie: :helpsmilie: :helpsmilie:

This post has been edited by andrewsw: 17 September 2014 - 04:31 AM
Reason for edit:: Learn to use CODE tags

Was This Post Helpful? 0
  • +
  • -

#8 andrewsw  Icon User is online

  • the case is sol-ved
  • member icon

Reputation: 6377
  • View blog
  • Posts: 25,768
  • Joined: 12-December 12

Re: transfering data from textbox of vb6 to the cells of excel

Posted 17 September 2014 - 04:36 AM

Topics merged, there is no need to start a new topic for this when you already have one open.

Did you study the tutorial I linked to, or find some other tutorial?

Yes, declare all your variables with the correct type.

Please also learn, or at least attempt, to use code tags.
Was This Post Helpful? 0
  • +
  • -

#9 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 21 September 2014 - 07:33 PM

Oh I'm sorry, I'm just so desperate to finish my project. Sorry for being so annoying. Yes I studied the tutorials that you gave and also I seek for other tutorials but still I can't input any data in my EXISTING EXCEL FILE.
Was This Post Helpful? 0
  • +
  • -

#10 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 23 September 2014 - 09:59 PM

Hi guys. I made it, I manage to input data in my existing excel file. but there is still one problem. I dont know how to determine the empty row where my next data will be inserted. I need help guys. I am hopeful to any suggestion. thanks in advance.

ice
Was This Post Helpful? 0
  • +
  • -

#11 ice23  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 10-September 14

Re: transfering data from textbox of vb6 to the cells of excel

Posted 28 September 2014 - 07:11 PM

Hi guys I use this code to input data in empty cells but unfortunately it goes to the last empty cell of the sheet and not in the first empty cell of the sheet. and I don't know how to reverse that to the first hope somebody can help me. I keep on asking questions but no one answers me except in one. this is the code I use.

lMaxRowNumber = oWB.Sheets("HLMR").Cells.SpecialCells(xlCellTypeLastCell).Row

please guys. thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1