| | |
open existing excel file in vba
![]() |
•
•
Join Date: Sep 2007
Posts: 6
Reputation:
Solved Threads: 0
im new in macro programming and vb
im doing a project office automation
how do i open (without showing) existing excel?
so i can manipulate the data
most of the snipet i see in the net is like this
Set oExcel = CreateObject("Excel.Application")
Set ExcelDoc = oExcel.Workbooks.Open(m_strPath & "project.xls")
i want the user to choose which excel file to edit
so a dialog box should prompt out
im thinking of using a dialog box
but i couldnt find any dialogbox button in vb 6
please help me
thanks in advance
im doing a project office automation
how do i open (without showing) existing excel?
so i can manipulate the data
most of the snipet i see in the net is like this
Set oExcel = CreateObject("Excel.Application")
Set ExcelDoc = oExcel.Workbooks.Open(m_strPath & "project.xls")
i want the user to choose which excel file to edit
so a dialog box should prompt out
im thinking of using a dialog box
but i couldnt find any dialogbox button in vb 6
please help me
thanks in advance
Hi,
Check below example, for it to work add the component "Microsoft Common Dialouge Control" and add one to your form:
Check below example, for it to work add the component "Microsoft Common Dialouge Control" and add one to your form:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
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
It is never about the number of languages you know, you either have the logic of programming or you don't ...
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
![]() |
Similar Threads
- Open Excel File (VB.NET)
- Getting A Data From Ms Eccess And Putting It In An Existing Excel File Using Vb 6.0 (Visual Basic 4 / 5 / 6)
- getting data from a text file and putting it in an excel file using visual basic 6.0 (Visual Basic 4 / 5 / 6)
- Open Excel file from Visual Basic (Visual Basic 4 / 5 / 6)
- How do I open existing excel document using vb6? (Visual Basic 4 / 5 / 6)
- VB - How to open an Excel Doc w/ existing data & add data in specific cells? (VB.NET)
- Open the exixting pdf file Using PHP (PHP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: How to automatically update temperature on the form load?
- Next Thread: which grid should I use
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





