Re: Embedded XML Workbook
- From: "Jeff Johnson" <i.get@xxxxxxxxxxx>
- Date: Mon, 31 Jul 2006 15:19:51 -0400
"Chris Jones" <chris.jones@xxxxxxxxx> wrote in message
news:12chigp2ism2je4@xxxxxxxxxxxxxxxxxxxxx
OK, perhaps thats too complicated to implement. How about simply
populating an excel workbook in the same folder as the source code and
then being able to update it?
populating a text box from an excel workbook*********
Sorry, just noticed the new replies. Yes, you can get info from your Excel
workbook. How you go about it depends on a couple of things. The main
question is "Will the end user have Excel installed?" More than likely the
answer is yes, but it's not a guarantee. If yes, you can use Automation to
read the data. If no, you can use ADO to read it, but the workbook will have
to be structured "nicely."
We'll assume the user will have Excel. Let's say your data is in cell B4 on
the first *** of your workbook. The following code will be pretty close to
what you need to do. (I say pretty close because I'm doing this off the top
of my head and I may get something wrong. It should be a good head start,
though.)
Dim xlApp As Object
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Open "C:\SomeFolder\MyWorkbook.xls"
txtWhatever.Text = xlApp.Workbooks(0).Sheets(0).Range("B4").Value
If your user won't have Excel, post back and I'll show you the ADO way.
.
- References:
- Embedded XML Workbook
- From: Chris Jones
- Re: Embedded XML Workbook
- From: Jeff Johnson
- Re: Embedded XML Workbook
- From: Chris Jones
- Re: Embedded XML Workbook
- From: Chris Jones
- Re: Embedded XML Workbook
- From: Chris Jones
- Embedded XML Workbook
- Prev by Date: Custom recports in VB
- Next by Date: how to transfer my exe program to Visual Basic
- Previous by thread: Re: Embedded XML Workbook
- Next by thread: VBX files
- Index(es):