How to import in mongo database?

Import excel data into access database in vb6 without enabling macros of excel..?

  • Hello... I am working on a application in vb6 but i am not able to import excel data in my access database through coding.. I have searched alot but didn't get any proper solution.. And one more thing i don't want to enable macros in excel just want to import data in access through vb6.. So can anyone help me with coding..?

  • Answer:

    Why are you using a version of VB from last centurty? You should be using the new dot net versions when making new applications. VB6 was released in 1998 and Microsoft stopped extended support in 2008. (Add areference to the windows common dialog and place on form) Private Sub Command1_Click() Dim xl Dim xlsheet Dim xlwbook Dim FilNam As String Me.CommonDialog1.ShowOpen FilNam = Me.CommonDialog1.FileName If Me.CommonDialog1.FileName <> "" Or Me.CommonDialog1.FileName <> ".xls" Then Set xl = CreateObject("Excel.Application") Set xlwbook = xl.Workbooks.Open(FilNam) Set xlsheet = xlwbook.Sheets.Item(1) xl.Visible = True 'Remove to hide the excel file Me.Text1 = xlsheet.range("A1") 'Do your work Set xl = Nothing Set xlwbook = Nothing Set xlsheet = Nothing End If End Sub

Gaurav at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

Connect to the Excel file like it is a database. And stop using VB6. Any new applications should be built using VB 2010.

AJ

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.