freelanceprogrammers.org Forum Index » ASP

Re: Populating Multiple list box from Excel Cell


View user's profile Post To page top
dmartin@... Posted: Thu Jan 12, 2006 1:19 am


Joined: 12 Jan 2006

Posts: 5
Re: Populating Multiple list box from Excel Cell
You need to use the Jet Provider:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

"HDR=Yes;" indicates that the first row contains column names, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text

TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed by
a "$" and wrapped in "[" "]" brackets.

Courtesy of http://www.connectionstrings.com/









Quoting Gregory Fox <greg@...>:

> HI,
>
> I appreciate the fast responses to: Passing ASP Session Variables to
> ASP.NET. I was able to to figure out a workaround.
>
> Now on to my current problem.
>
> I need to import items from an Excel worksheet cell that was previously
> populated by importing from a multiple line listbox on a ASP.Net form. The
> import, as you know, was comma separated values.
>
> Does anyone have a code snippet that will accomplish this?
>
> Thanks again for your help.
>
> Gregory D. Fox
> Liberty Web Hosting & Design
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Providing Internet Solutions Since 1996
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 1:58 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
I already have the worksheet importing into the other fields. It`s just this
listbox that I am having trouble on.

_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of
dmartin@...
Sent: Wednesday, January 11, 2006 2:20 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell



You need to use the Jet Provider:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

"HDR=Yes;" indicates that the first row contains column names, not data
"IMEX=1;" tells the driver to always read "intermixed" data columns as text

TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed by

a "$" and wrapped in "[" "]" brackets.

Courtesy of http://www.connectionstrings.com/









Quoting Gregory Fox <greg@...>:

> HI,
>
> I appreciate the fast responses to: Passing ASP Session Variables to
> ASP.NET. I was able to to figure out a workaround.
>
> Now on to my current problem.
>
> I need to import items from an Excel worksheet cell that was previously
> populated by importing from a multiple line listbox on a ASP.Net form. The
> import, as you know, was comma separated values.
>
> Does anyone have a code snippet that will accomplish this?
>
> Thanks again for your help.
>
> Gregory D. Fox
> Liberty Web Hosting & Design
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Providing Internet Solutions Since 1996
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>




_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Thu Jan 12, 2006 2:16 am


Joined: 11 Jan 2006

Posts: 38
Re: Populating Multiple list box from Excel Cell
If you`re getting data with a select query, wouldn`t you just bind it to
whatever control you want? Maybe we need a bit more information here.


On 1/11/06, Gregory Fox <greg@...> wrote:
>
> I already have the worksheet importing into the other fields. It`s just
> this
> listbox that I am having trouble on.
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of
> dmartin@...
>
> You need to use the Jet Provider:
>
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
> Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
>
> "HDR=Yes;" indicates that the first row contains column names, not data
> "IMEX=1;" tells the driver to always read "intermixed" data columns as
> text
>
> TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed
> by
>
> a "$" and wrapped in "[" "]" brackets.
>
> Courtesy of http://www.connectionstrings.com/
>
> Quoting Gregory Fox <greg@...>:
>
> > HI,
> >
> > I appreciate the fast responses to: Passing ASP Session Variables to
> > ASP.NET. I was able to to figure out a workaround.
> >
> > Now on to my current problem.
> >
> > I need to import items from an Excel worksheet cell that was previously
> > populated by importing from a multiple line listbox on a ASP.Net form.
> The
> > import, as you know, was comma separated values.
> >
> > Does anyone have a code snippet that will accomplish this?
> >
> > Thanks again for your help.
> >
> > Gregory D. Fox
> > Liberty Web Hosting & Design
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Providing Internet Solutions Since 1996


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 2:23 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
I am not using a databinder I am using:

Location2.SelectedValue =
ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value

I think I need to somehow create a loop.

Thanks,
Greg


_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
Sent: Wednesday, January 11, 2006 3:16 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


If you`re getting data with a select query, wouldn`t you just bind it to
whatever control you want? Maybe we need a bit more information here.


On 1/11/06, Gregory Fox <greg@...> wrote:
>
> I already have the worksheet importing into the other fields. It`s just
> this
> listbox that I am having trouble on.
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of
> dmartin@...
>
> You need to use the Jet Provider:
>
> "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
> Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
>
> "HDR=Yes;" indicates that the first row contains column names, not data
> "IMEX=1;" tells the driver to always read "intermixed" data columns as
> text
>
> TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name followed
> by
>
> a "$" and wrapped in "[" "]" brackets.
>
> Courtesy of http://www.connectionstrings.com/
>
> Quoting Gregory Fox <greg@...>:
>
> > HI,
> >
> > I appreciate the fast responses to: Passing ASP Session Variables to
> > ASP.NET. I was able to to figure out a workaround.
> >
> > Now on to my current problem.
> >
> > I need to import items from an Excel worksheet cell that was previously
> > populated by importing from a multiple line listbox on a ASP.Net form.
> The
> > import, as you know, was comma separated values.
> >
> > Does anyone have a code snippet that will accomplish this?
> >
> > Thanks again for your help.
> >
> > Gregory D. Fox
> > Liberty Web Hosting & Design
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > Providing Internet Solutions Since 1996


[Non-text portions of this message have been removed]




SPONSORED LINKS
Basic
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
programming language Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
programming languages Programming
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages

Java
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
programming language

_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Thu Jan 12, 2006 2:37 am


Joined: 11 Jan 2006

Posts: 38
Re: Populating Multiple list box from Excel Cell
Ohhh, okay! I`m a little slow today.

So you have a comma-delimited string of values, right? The simplest thing
to do would probably be to use the String.Split method to create an array,
and then loop through the array (as you surmised) doing this:

myList.Items.FindByValue(myArray[myIndex]).Selected = True

Of course with EasyListBox, you could just set the SelectedValue to the
comma-delimited string, but they didn`t ask me :)

Cheers,

Peter


On 1/11/06, Gregory Fox <greg@...> wrote:
>
> I am not using a databinder I am using:
>
> Location2.SelectedValue =
> ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
>
> I think I need to somehow create a loop.
>
> Thanks,
> Greg
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
> Sent: Wednesday, January 11, 2006 3:16 PM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from
> Excel
> Cell
>
>
> If you`re getting data with a select query, wouldn`t you just bind it to
> whatever control you want? Maybe we need a bit more information here.
>
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > I already have the worksheet importing into the other fields. It`s just
> > this
> > listbox that I am having trouble on.
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of
> > dmartin@...
> >
> > You need to use the Jet Provider:
> >
> > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
> > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> >
> > "HDR=Yes;" indicates that the first row contains column names, not data
> > "IMEX=1;" tells the driver to always read "intermixed" data columns as
> > text
> >
> > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> followed
> > by
> >
> > a "$" and wrapped in "[" "]" brackets.
> >
> > Courtesy of http://www.connectionstrings.com/
> >
> > Quoting Gregory Fox <greg@...>:
> >
> > > HI,
> > >
> > > I appreciate the fast responses to: Passing ASP Session Variables to
> > > ASP.NET. I was able to to figure out a workaround.
> > >
> > > Now on to my current problem.
> > >
> > > I need to import items from an Excel worksheet cell that was
> previously
> > > populated by importing from a multiple line listbox on a ASP.Net form.
> > The
> > > import, as you know, was comma separated values.
> > >
> > > Does anyone have a code snippet that will accomplish this?
> > >
> > > Thanks again for your help.
> > >
> > > Gregory D. Fox
> > > Liberty Web Hosting & Design
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > Providing Internet Solutions Since 1996
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> SPONSORED LINKS
> Basic
> <
> http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
>
> gramming+language&w2=Computer+programming+languages&w3=Programming+languages
> &w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
> programming language Computer
> <
> http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
>
> +programming+language&w2=Computer+programming+languages&w3=Programming+langu
> ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
> programming languages Programming
> <
> http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
>
> ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
> ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages
>
> Java
> <
> http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
>
> ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
> w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
> programming language
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> ?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 2:41 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
Yes, Comma-delimited.

_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
Sent: Wednesday, January 11, 2006 3:38 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


Ohhh, okay! I`m a little slow today.

So you have a comma-delimited string of values, right? The simplest thing
to do would probably be to use the String.Split method to create an array,
and then loop through the array (as you surmised) doing this:

myList.Items.FindByValue(myArray[myIndex]).Selected = True

Of course with EasyListBox, you could just set the SelectedValue to the
comma-delimited string, but they didn`t ask me :)

Cheers,

Peter


On 1/11/06, Gregory Fox <greg@...> wrote:
>
> I am not using a databinder I am using:
>
> Location2.SelectedValue =
> ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
>
> I think I need to somehow create a loop.
>
> Thanks,
> Greg
>
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
> Sent: Wednesday, January 11, 2006 3:16 PM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from
> Excel
> Cell
>
>
> If you`re getting data with a select query, wouldn`t you just bind it to
> whatever control you want? Maybe we need a bit more information here.
>
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > I already have the worksheet importing into the other fields. It`s just
> > this
> > listbox that I am having trouble on.
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of
> > dmartin@...
> >
> > You need to use the Jet Provider:
> >
> > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
> > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> >
> > "HDR=Yes;" indicates that the first row contains column names, not data
> > "IMEX=1;" tells the driver to always read "intermixed" data columns as
> > text
> >
> > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> followed
> > by
> >
> > a "$" and wrapped in "[" "]" brackets.
> >
> > Courtesy of http://www.connectionstrings.com/
> >
> > Quoting Gregory Fox <greg@...>:
> >
> > > HI,
> > >
> > > I appreciate the fast responses to: Passing ASP Session Variables to
> > > ASP.NET. I was able to to figure out a workaround.
> > >
> > > Now on to my current problem.
> > >
> > > I need to import items from an Excel worksheet cell that was
> previously
> > > populated by importing from a multiple line listbox on a ASP.Net form.
> > The
> > > import, as you know, was comma separated values.
> > >
> > > Does anyone have a code snippet that will accomplish this?
> > >
> > > Thanks again for your help.
> > >
> > > Gregory D. Fox
> > > Liberty Web Hosting & Design
> > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > Providing Internet Solutions Since 1996
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> SPONSORED LINKS
> Basic
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
> &k=Basic+programming+language&w1=Basic+pro
>
>
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
> &w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
> programming language Computer
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
> &k=Computer+programming+languages&w1=Basic
>
>
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
> ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
> programming languages Programming
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
> &k=Programming+languages&w1=Basic+programm
>
>
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
> ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages
>
> Java
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
> &k=Java+programming+language&w1=Basic+prog
>
>
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
> w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
> programming language
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> ?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]




SPONSORED LINKS
Basic
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
programming language Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
programming languages Programming
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages

Java
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
programming language

_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Thu Jan 12, 2006 3:17 am


Joined: 11 Jan 2006

Posts: 38
Re: Populating Multiple list box from Excel Cell
...so then did the rest of my email help, or do you still need more?

On 1/11/06, Gregory Fox <greg@...> wrote:
>
> Yes, Comma-delimited.
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of Peter Brunone
>
> Ohhh, okay! I`m a little slow today.
>
> So you have a comma-delimited string of values, right? The simplest thing
> to do would probably be to use the String.Split method to create an array,
> and then loop through the array (as you surmised) doing this:
>
> myList.Items.FindByValue(myArray[myIndex]).Selected = True
>
> Of course with EasyListBox, you could just set the SelectedValue to the
> comma-delimited string, but they didn`t ask me :)
>
> Cheers,
>
> Peter
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > I am not using a databinder I am using:
> >
> > Location2.SelectedValue =
> > ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
> >
> > I think I need to somehow create a loop.
> >
> > Thanks,
> > Greg
> >
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of Peter Brunone
> >
> > If you`re getting data with a select query, wouldn`t you just bind it to
> > whatever control you want? Maybe we need a bit more information here.
> >
> > On 1/11/06, Gregory Fox <greg@...> wrote:
> > >
> > > I already have the worksheet importing into the other fields. It`s
> just
> > > this
> > > listbox that I am having trouble on.
> > >
> > > _____
> > >
> > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of
> > > dmartin@...
> > >
> > > You need to use the Jet Provider:
> > >
> > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
> > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> > >
> > > "HDR=Yes;" indicates that the first row contains column names, not
> data
> > > "IMEX=1;" tells the driver to always read "intermixed" data columns as
> > > text
> > >
> > > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> > followed
> > > by
> > >
> > > a "$" and wrapped in "[" "]" brackets.
> > >
> > > Courtesy of http://www.connectionstrings.com/
> > >
> > > Quoting Gregory Fox <greg@...>:
> > >
> > > > HI,
> > > >
> > > > I appreciate the fast responses to: Passing ASP Session Variables to
> > > > ASP.NET. I was able to to figure out a workaround.
> > > >
> > > > Now on to my current problem.
> > > >
> > > > I need to import items from an Excel worksheet cell that was
> > previously
> > > > populated by importing from a multiple line listbox on a ASP.Netform.
> > > The
> > > > import, as you know, was comma separated values.
> > > >
> > > > Does anyone have a code snippet that will accomplish this?
> > > >
> > > > Thanks again for your help.
> > > >
> > > > Gregory D. Fox
> > > > Liberty Web Hosting & Design
> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > Providing Internet Solutions Since 1996


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 3:26 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
Yes, that would be appreciated.

_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
Sent: Wednesday, January 11, 2006 4:17 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


...so then did the rest of my email help, or do you still need more?

On 1/11/06, Gregory Fox <greg@...> wrote:
>
> Yes, Comma-delimited.
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of Peter Brunone
>
> Ohhh, okay! I`m a little slow today.
>
> So you have a comma-delimited string of values, right? The simplest thing
> to do would probably be to use the String.Split method to create an array,
> and then loop through the array (as you surmised) doing this:
>
> myList.Items.FindByValue(myArray[myIndex]).Selected = True
>
> Of course with EasyListBox, you could just set the SelectedValue to the
> comma-delimited string, but they didn`t ask me :)
>
> Cheers,
>
> Peter
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > I am not using a databinder I am using:
> >
> > Location2.SelectedValue =
> > ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
> >
> > I think I need to somehow create a loop.
> >
> > Thanks,
> > Greg
> >
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of Peter Brunone
> >
> > If you`re getting data with a select query, wouldn`t you just bind it to
> > whatever control you want? Maybe we need a bit more information here.
> >
> > On 1/11/06, Gregory Fox <greg@...> wrote:
> > >
> > > I already have the worksheet importing into the other fields. It`s
> just
> > > this
> > > listbox that I am having trouble on.
> > >
> > > _____
> > >
> > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of
> > > dmartin@...
> > >
> > > You need to use the Jet Provider:
> > >
> > > "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:MyExcel.xls;Extended
> > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> > >
> > > "HDR=Yes;" indicates that the first row contains column names, not
> data
> > > "IMEX=1;" tells the driver to always read "intermixed" data columns as
> > > text
> > >
> > > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> > followed
> > > by
> > >
> > > a "$" and wrapped in "[" "]" brackets.
> > >
> > > Courtesy of http://www.connectionstrings.com/
> > >
> > > Quoting Gregory Fox <greg@...>:
> > >
> > > > HI,
> > > >
> > > > I appreciate the fast responses to: Passing ASP Session Variables to
> > > > ASP.NET. I was able to to figure out a workaround.
> > > >
> > > > Now on to my current problem.
> > > >
> > > > I need to import items from an Excel worksheet cell that was
> > previously
> > > > populated by importing from a multiple line listbox on a
ASP.Netform.
> > > The
> > > > import, as you know, was comma separated values.
> > > >
> > > > Does anyone have a code snippet that will accomplish this?
> > > >
> > > > Thanks again for your help.
> > > >
> > > > Gregory D. Fox
> > > > Liberty Web Hosting & Design
> > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > Providing Internet Solutions Since 1996


[Non-text portions of this message have been removed]




SPONSORED LINKS
Basic
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
programming language Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
programming languages Programming
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages

Java
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
programming language

_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Thu Jan 12, 2006 3:54 am


Joined: 11 Jan 2006

Posts: 38
Re: Populating Multiple list box from Excel Cell
Dim myArray As Array = thatExcelCellvalue.Split(",")
Dim iValue As Integer = 0

For iValue = 0 To myArray.Length - 1
myListBox.Items.FindByValue(myArray(iValue)).Selected = True
Next


(you could use a String array instead to be more efficient, but I just
whipped this out)


On 1/11/06, Gregory Fox <greg@...> wrote:
>
> Yes, that would be appreciated.
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of Peter Brunone
>
> ...so then did the rest of my email help, or do you still need more?
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > Yes, Comma-delimited.
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of Peter Brunone
> >
> > Ohhh, okay! I`m a little slow today.
> >
> > So you have a comma-delimited string of values, right? The simplest
> thing
> > to do would probably be to use the String.Split method to create an
> array,
> > and then loop through the array (as you surmised) doing this:
> >
> > myList.Items.FindByValue(myArray[myIndex]).Selected = True
> >
> > Of course with EasyListBox, you could just set the SelectedValue to the
> > comma-delimited string, but they didn`t ask me :)
> >
> > Cheers,
> >
> > Peter
> >
> > On 1/11/06, Gregory Fox <greg@...> wrote:
> > >
> > > I am not using a databinder I am using:
> > >
> > > Location2.SelectedValue =
> > > ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
> > >
> > > I think I need to somehow create a loop.
> > >
> > > Thanks,
> > > Greg
> > > _____
> > >
> > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of Peter Brunone
> > >
> > > If you`re getting data with a select query, wouldn`t you just bind it
> to
> > > whatever control you want? Maybe we need a bit more information here.
> > >
> > > On 1/11/06, Gregory Fox <greg@...> wrote:
> > > >
> > > > I already have the worksheet importing into the other fields. It`s
> > just
> > > > this
> > > > listbox that I am having trouble on.
> > > >
> > > > _____
> > > >
> > > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of
> > > > dmartin@...
> > > >
> > > > You need to use the Jet Provider:
> > > >
> > > > "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:MyExcel.xls;Extended
> > > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> > > >
> > > > "HDR=Yes;" indicates that the first row contains column names, not
> > data
> > > > "IMEX=1;" tells the driver to always read "intermixed" data columns
> as
> > > > text
> > > >
> > > > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> > > followed
> > > > by
> > > >
> > > > a "$" and wrapped in "[" "]" brackets.
> > > >
> > > > Courtesy of http://www.connectionstrings.com/
> > > >
> > > > Quoting Gregory Fox <greg@...>:
> > > >
> > > > > HI,
> > > > >
> > > > > I appreciate the fast responses to: Passing ASP Session Variables
> to
> > > > > ASP.NET. I was able to to figure out a workaround.
> > > > >
> > > > > Now on to my current problem.
> > > > >
> > > > > I need to import items from an Excel worksheet cell that was
> > > previously
> > > > > populated by importing from a multiple line listbox on a
> ASP.Netform.
> > > > The
> > > > > import, as you know, was comma separated values.
> > > > >
> > > > > Does anyone have a code snippet that will accomplish this?
> > > > >
> > > > > Thanks again for your help.
> > > > >
> > > > > Gregory D. Fox
> > > > > Liberty Web Hosting & Design
> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > Providing Internet Solutions Since 1996


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 4:10 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
Peter,

I really appreciate your help.

Here is the code:

----------------------------
Dim myArray As Array =
ExcelApp.Workbooks(1).Worksheets(2).Range("F76").Split(",")

Dim iValue As Integer = 0

For iValue = 0 To myArray.Length - 1

Location1.Items.FindByValue(myArray(iValue)).Selected = True

Next
-------------------------

Here is what is being returned:

Microsoft.VisualBasic - Public member `Split` on type `Range` not found.

I checked to make sure the F76 is indeed the right cell and it was.

Any ideas?

Greg

_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
Sent: Wednesday, January 11, 2006 4:54 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


Dim myArray As Array = thatExcelCellvalue.Split(",")
Dim iValue As Integer = 0

For iValue = 0 To myArray.Length - 1
myListBox.Items.FindByValue(myArray(iValue)).Selected = True
Next


(you could use a String array instead to be more efficient, but I just
whipped this out)


On 1/11/06, Gregory Fox <greg@...> wrote:
>
> Yes, that would be appreciated.
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> On Behalf Of Peter Brunone
>
> ...so then did the rest of my email help, or do you still need more?
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > Yes, Comma-delimited.
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of Peter Brunone
> >
> > Ohhh, okay! I`m a little slow today.
> >
> > So you have a comma-delimited string of values, right? The simplest
> thing
> > to do would probably be to use the String.Split method to create an
> array,
> > and then loop through the array (as you surmised) doing this:
> >
> > myList.Items.FindByValue(myArray[myIndex]).Selected = True
> >
> > Of course with EasyListBox, you could just set the SelectedValue to the
> > comma-delimited string, but they didn`t ask me :)
> >
> > Cheers,
> >
> > Peter
> >
> > On 1/11/06, Gregory Fox <greg@...> wrote:
> > >
> > > I am not using a databinder I am using:
> > >
> > > Location2.SelectedValue =
> > > ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
> > >
> > > I think I need to somehow create a loop.
> > >
> > > Thanks,
> > > Greg
> > > _____
> > >
> > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of Peter Brunone
> > >
> > > If you`re getting data with a select query, wouldn`t you just bind it
> to
> > > whatever control you want? Maybe we need a bit more information here.
> > >
> > > On 1/11/06, Gregory Fox <greg@...> wrote:
> > > >
> > > > I already have the worksheet importing into the other fields. It`s
> > just
> > > > this
> > > > listbox that I am having trouble on.
> > > >
> > > > _____
> > > >
> > > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of
> > > > dmartin@...
> > > >
> > > > You need to use the Jet Provider:
> > > >
> > > > "Provider=Microsoft.Jet.OLEDB.4.0;Data
> Source=C:MyExcel.xls;Extended
> > > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> > > >
> > > > "HDR=Yes;" indicates that the first row contains column names, not
> > data
> > > > "IMEX=1;" tells the driver to always read "intermixed" data columns
> as
> > > > text
> > > >
> > > > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> > > followed
> > > > by
> > > >
> > > > a "$" and wrapped in "[" "]" brackets.
> > > >
> > > > Courtesy of http://www.connectionstrings.com/
> > > >
> > > > Quoting Gregory Fox <greg@...>:
> > > >
> > > > > HI,
> > > > >
> > > > > I appreciate the fast responses to: Passing ASP Session Variables
> to
> > > > > ASP.NET. I was able to to figure out a workaround.
> > > > >
> > > > > Now on to my current problem.
> > > > >
> > > > > I need to import items from an Excel worksheet cell that was
> > > previously
> > > > > populated by importing from a multiple line listbox on a
> ASP.Netform.
> > > > The
> > > > > import, as you know, was comma separated values.
> > > > >
> > > > > Does anyone have a code snippet that will accomplish this?
> > > > >
> > > > > Thanks again for your help.
> > > > >
> > > > > Gregory D. Fox
> > > > > Liberty Web Hosting & Design
> > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > Providing Internet Solutions Since 1996


[Non-text portions of this message have been removed]




SPONSORED LINKS
Basic
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
programming language Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
programming languages Programming
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages

Java
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
programming language

_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
aemca_san Posted: Thu Jan 12, 2006 4:10 am


Joined: 10 Jan 2006

Posts: 12
Re: Populating Multiple list box from Excel Cell
Keep in mind though that reading from an excel sheet directly isn`t
recommended practice.
( Excel isn`t what you would call a scalable database solution )

using OLE DB is doable for a few hits an hour

using automation is doable for a few hits a day :P

You will want to cache things if you can, you can do this by putting things
into a cached object and using a filesystemwatcher to monitor the excel
sheet.

Good luck :)



----- Original Message -----
From: "Gregory Fox" <greg@...>
To: <AspNetAnyQuestionIsOk@yahoogroups.com>
Sent: Wednesday, January 11, 2006 7:26 PM
Subject: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


> HI,
>
> I appreciate the fast responses to: Passing ASP Session Variables to
> ASP.NET. I was able to to figure out a workaround.
>
> Now on to my current problem.
>
> I need to import items from an Excel worksheet cell that was previously
> populated by importing from a multiple line listbox on a ASP.Net form. The
> import, as you know, was comma separated values.
>
> Does anyone have a code snippet that will accomplish this?
>
> Thanks again for your help.
>
> Gregory D. Fox
> Liberty Web Hosting & Design
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Providing Internet Solutions Since 1996
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 4:15 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
Yes I know, This is an internal app and not available for public
consumption. Also, this is something that was already working. I am adding
more functionality.

_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Mischa Kroon
Sent: Wednesday, January 11, 2006 5:11 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


Keep in mind though that reading from an excel sheet directly isn`t
recommended practice.
( Excel isn`t what you would call a scalable database solution )

using OLE DB is doable for a few hits an hour

using automation is doable for a few hits a day :P

You will want to cache things if you can, you can do this by putting things
into a cached object and using a filesystemwatcher to monitor the excel
sheet.

Good luck :)



----- Original Message -----
From: "Gregory Fox" <greg@...>
To: <AspNetAnyQuestionIsOk@yahoogroups.com>
Sent: Wednesday, January 11, 2006 7:26 PM
Subject: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


> HI,
>
> I appreciate the fast responses to: Passing ASP Session Variables to
> ASP.NET. I was able to to figure out a workaround.
>
> Now on to my current problem.
>
> I need to import items from an Excel worksheet cell that was previously
> populated by importing from a multiple line listbox on a ASP.Net form. The
> import, as you know, was comma separated values.
>
> Does anyone have a code snippet that will accomplish this?
>
> Thanks again for your help.
>
> Gregory D. Fox
> Liberty Web Hosting & Design
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Providing Internet Solutions Since 1996
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>




SPONSORED LINKS
Basic
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
programming language Computer
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
programming languages Programming
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages

Java
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
programming language

_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
peter_brunone Posted: Thu Jan 12, 2006 4:17 am


Joined: 11 Jan 2006

Posts: 38
Re: Populating Multiple list box from Excel Cell
Gregory,

I haven`t done any Excel manipulation in a while; is there perhaps a
Value property that you can access on the Range? Something like:

ExcelApp.Workbooks(1).Worksheets(2).Range("F76").Value.ToString().Split(",")

(if that wraps, put it all back together on one line)

Peter

On 1/11/06, Gregory Fox <greg@...> wrote:
>
> Peter,
>
> I really appreciate your help.
>
> Here is the code:
>
> ----------------------------
> Dim myArray As Array =
> ExcelApp.Workbooks(1).Worksheets(2).Range("F76").Split(",")
>
> Dim iValue As Integer = 0
>
> For iValue = 0 To myArray.Length - 1
>
> Location1.Items.FindByValue(myArray(iValue)).Selected = True
>
> Next
> -------------------------
>
> Here is what is being returned:
>
> Microsoft.VisualBasic - Public member `Split` on type `Range` not found.
>
> I checked to make sure the F76 is indeed the right cell and it was.
>
> Any ideas?
>
> Greg
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
> Sent: Wednesday, January 11, 2006 4:54 PM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from
> Excel
> Cell
>
>
> Dim myArray As Array = thatExcelCellvalue.Split(",")
> Dim iValue As Integer = 0
>
> For iValue = 0 To myArray.Length - 1
> myListBox.Items.FindByValue(myArray(iValue)).Selected = True
> Next
>
>
> (you could use a String array instead to be more efficient, but I just
> whipped this out)
>
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > Yes, that would be appreciated.
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of Peter Brunone
> >
> > ...so then did the rest of my email help, or do you still need more?
> >
> > On 1/11/06, Gregory Fox <greg@...> wrote:
> > >
> > > Yes, Comma-delimited.
> > >
> > > _____
> > >
> > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > > On Behalf Of Peter Brunone
> > >
> > > Ohhh, okay! I`m a little slow today.
> > >
> > > So you have a comma-delimited string of values, right? The simplest
> > thing
> > > to do would probably be to use the String.Split method to create an
> > array,
> > > and then loop through the array (as you surmised) doing this:
> > >
> > > myList.Items.FindByValue(myArray[myIndex]).Selected = True
> > >
> > > Of course with EasyListBox, you could just set the SelectedValue to
> the
> > > comma-delimited string, but they didn`t ask me :)
> > >
> > > Cheers,
> > >
> > > Peter
> > >
> > > On 1/11/06, Gregory Fox <greg@...> wrote:
> > > >
> > > > I am not using a databinder I am using:
> > > >
> > > > Location2.SelectedValue =
> > > > ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
> > > >
> > > > I think I need to somehow create a loop.
> > > >
> > > > Thanks,
> > > > Greg
> > > > _____
> > > >
> > > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > > On Behalf Of Peter Brunone
> > > >
> > > > If you`re getting data with a select query, wouldn`t you just bind
> it
> > to
> > > > whatever control you want? Maybe we need a bit more information
> here.
> > > >
> > > > On 1/11/06, Gregory Fox <greg@...> wrote:
> > > > >
> > > > > I already have the worksheet importing into the other fields. It`s
> > > just
> > > > > this
> > > > > listbox that I am having trouble on.
> > > > >
> > > > > _____
> > > > >
> > > > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > > On Behalf Of
> > > > > dmartin@...
> > > > >
> > > > > You need to use the Jet Provider:
> > > > >
> > > > > "Provider=Microsoft.Jet.OLEDB.4.0;Data
> > Source=C:MyExcel.xls;Extended
> > > > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> > > > >
> > > > > "HDR=Yes;" indicates that the first row contains column names, not
> > > data
> > > > > "IMEX=1;" tells the driver to always read "intermixed" data
> columns
> > as
> > > > > text
> > > > >
> > > > > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> > > > followed
> > > > > by
> > > > >
> > > > > a "$" and wrapped in "[" "]" brackets.
> > > > >
> > > > > Courtesy of http://www.connectionstrings.com/
> > > > >
> > > > > Quoting Gregory Fox <greg@...>:
> > > > >
> > > > > > HI,
> > > > > >
> > > > > > I appreciate the fast responses to: Passing ASP Session
> Variables
> > to
> > > > > > ASP.NET. I was able to to figure out a workaround.
> > > > > >
> > > > > > Now on to my current problem.
> > > > > >
> > > > > > I need to import items from an Excel worksheet cell that was
> > > > previously
> > > > > > populated by importing from a multiple line listbox on a
> > ASP.Netform.
> > > > > The
> > > > > > import, as you know, was comma separated values.
> > > > > >
> > > > > > Does anyone have a code snippet that will accomplish this?
> > > > > >
> > > > > > Thanks again for your help.
> > > > > >
> > > > > > Gregory D. Fox
> > > > > > Liberty Web Hosting & Design
> > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > Providing Internet Solutions Since 1996
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> SPONSORED LINKS
> Basic
> <
> http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
>
> gramming+language&w2=Computer+programming+languages&w3=Programming+languages
> &w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
> programming language Computer
> <
> http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
>
> +programming+language&w2=Computer+programming+languages&w3=Programming+langu
> ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
> programming languages Programming
> <
> http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
>
> ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
> ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages
>
> Java
> <
> http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
>
> ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
> w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
> programming language
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> ?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]
Reply with quote
Send private message
View user's profile Post To page top
libertyhosting Posted: Thu Jan 12, 2006 4:34 am


Joined: 11 Jan 2006

Posts: 9
Re: Populating Multiple list box from Excel Cell
Peter,

That did the trick.

Thanks for all your help.

Greg

_____

From: AspNetAnyQuestionIsOk@yahoogroups.com
[mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
Sent: Wednesday, January 11, 2006 5:18 PM
To: AspNetAnyQuestionIsOk@yahoogroups.com
Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from Excel
Cell


Gregory,

I haven`t done any Excel manipulation in a while; is there perhaps a
Value property that you can access on the Range? Something like:

ExcelApp.Workbooks(1).Worksheets(2).Range("F76").Value.ToString().Split(",")

(if that wraps, put it all back together on one line)

Peter

On 1/11/06, Gregory Fox <greg@...> wrote:
>
> Peter,
>
> I really appreciate your help.
>
> Here is the code:
>
> ----------------------------
> Dim myArray As Array =
> ExcelApp.Workbooks(1).Worksheets(2).Range("F76").Split(",")
>
> Dim iValue As Integer = 0
>
> For iValue = 0 To myArray.Length - 1
>
> Location1.Items.FindByValue(myArray(iValue)).Selected = True
>
> Next
> -------------------------
>
> Here is what is being returned:
>
> Microsoft.VisualBasic - Public member `Split` on type `Range` not found.
>
> I checked to make sure the F76 is indeed the right cell and it was.
>
> Any ideas?
>
> Greg
>
> _____
>
> From: AspNetAnyQuestionIsOk@yahoogroups.com
> [mailto:AspNetAnyQuestionIsOk@yahoogroups.com] On Behalf Of Peter Brunone
> Sent: Wednesday, January 11, 2006 4:54 PM
> To: AspNetAnyQuestionIsOk@yahoogroups.com
> Subject: Re: [AspNetAnyQuestionIsOk] Populating Multiple list box from
> Excel
> Cell
>
>
> Dim myArray As Array = thatExcelCellvalue.Split(",")
> Dim iValue As Integer = 0
>
> For iValue = 0 To myArray.Length - 1
> myListBox.Items.FindByValue(myArray(iValue)).Selected = True
> Next
>
>
> (you could use a String array instead to be more efficient, but I just
> whipped this out)
>
>
> On 1/11/06, Gregory Fox <greg@...> wrote:
> >
> > Yes, that would be appreciated.
> >
> > _____
> >
> > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > On Behalf Of Peter Brunone
> >
> > ...so then did the rest of my email help, or do you still need more?
> >
> > On 1/11/06, Gregory Fox <greg@...> wrote:
> > >
> > > Yes, Comma-delimited.
> > >
> > > _____
> > >
> > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > > On Behalf Of Peter Brunone
> > >
> > > Ohhh, okay! I`m a little slow today.
> > >
> > > So you have a comma-delimited string of values, right? The simplest
> > thing
> > > to do would probably be to use the String.Split method to create an
> > array,
> > > and then loop through the array (as you surmised) doing this:
> > >
> > > myList.Items.FindByValue(myArray[myIndex]).Selected = True
> > >
> > > Of course with EasyListBox, you could just set the SelectedValue to
> the
> > > comma-delimited string, but they didn`t ask me :)
> > >
> > > Cheers,
> > >
> > > Peter
> > >
> > > On 1/11/06, Gregory Fox <greg@...> wrote:
> > > >
> > > > I am not using a databinder I am using:
> > > >
> > > > Location2.SelectedValue =
> > > > ExcelApp.Workbooks(1).Worksheets(2).Range("F77").Value
> > > >
> > > > I think I need to somehow create a loop.
> > > >
> > > > Thanks,
> > > > Greg
> > > > _____
> > > >
> > > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > > On Behalf Of Peter Brunone
> > > >
> > > > If you`re getting data with a select query, wouldn`t you just bind
> it
> > to
> > > > whatever control you want? Maybe we need a bit more information
> here.
> > > >
> > > > On 1/11/06, Gregory Fox <greg@...> wrote:
> > > > >
> > > > > I already have the worksheet importing into the other fields. It`s
> > > just
> > > > > this
> > > > > listbox that I am having trouble on.
> > > > >
> > > > > _____
> > > > >
> > > > > From: AspNetAnyQuestionIsOk@yahoogroups.com
> > > On Behalf Of
> > > > > dmartin@...
> > > > >
> > > > > You need to use the Jet Provider:
> > > > >
> > > > > "Provider=Microsoft.Jet.OLEDB.4.0;Data
> > Source=C:MyExcel.xls;Extended
> > > > > Properties=""Excel 8.0;HDR=Yes;IMEX=1"""
> > > > >
> > > > > "HDR=Yes;" indicates that the first row contains column names, not
> > > data
> > > > > "IMEX=1;" tells the driver to always read "intermixed" data
> columns
> > as
> > > > > text
> > > > >
> > > > > TIP! SQL syntax: "SELECT * FROM [sheet1$]" - i.e. worksheet name
> > > > followed
> > > > > by
> > > > >
> > > > > a "$" and wrapped in "[" "]" brackets.
> > > > >
> > > > > Courtesy of http://www.connectionstrings.com/
> > > > >
> > > > > Quoting Gregory Fox <greg@...>:
> > > > >
> > > > > > HI,
> > > > > >
> > > > > > I appreciate the fast responses to: Passing ASP Session
> Variables
> > to
> > > > > > ASP.NET. I was able to to figure out a workaround.
> > > > > >
> > > > > > Now on to my current problem.
> > > > > >
> > > > > > I need to import items from an Excel worksheet cell that was
> > > > previously
> > > > > > populated by importing from a multiple line listbox on a
> > ASP.Netform.
> > > > > The
> > > > > > import, as you know, was comma separated values.
> > > > > >
> > > > > > Does anyone have a code snippet that will accomplish this?
> > > > > >
> > > > > > Thanks again for your help.
> > > > > >
> > > > > > Gregory D. Fox
> > > > > > Liberty Web Hosting & Design
> > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > > Providing Internet Solutions Since 1996
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> SPONSORED LINKS
> Basic
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic+pro
> &k=Basic+programming+language&w1=Basic+pro
>
>
gramming+language&w2=Computer+programming+languages&w3=Programming+languages
> &w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbVU-A>
> programming language Computer
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=Basic
> &k=Computer+programming+languages&w1=Basic
>
>
+programming+language&w2=Computer+programming+languages&w3=Programming+langu
> ages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KVZQperFQ>
> programming languages Programming
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+programm
> &k=Programming+languages&w1=Basic+programm
>
>
ing+language&w2=Computer+programming+languages&w3=Programming+languages&w4=J
> ava+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> languages
>
> Java
> <
> http://groups.yahoo.com/gads?t=ms
<http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+prog
> &k=Java+programming+language&w1=Basic+prog
>
>
ramming+language&w2=Computer+programming+languages&w3=Programming+languages&
> w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB1g>
> programming language
>
> _____
>
> YAHOO! GROUPS LINKS
>
>
>
> * Visit your group "AspNetAnyQuestionIsOk
> <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.
>
>
> * To unsubscribe from this group, send an email to:
> AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> <mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
> ?subject=Unsubscrib
> e>
>
>
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> <http://docs.yahoo.com/info/terms/> .
>
>
> _____
>
>
>
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
>


[Non-text portions of this message have been removed]



_____

YAHOO! GROUPS LINKS



* Visit your group "AspNetAnyQuestionIsOk
<http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web.


* To unsubscribe from this group, send an email to:
AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com
<mailto:AspNetAnyQuestionIsOk-unsubscribe@yahoogroups.com?subject=Unsubscrib
e>


* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .


_____




[Non-text portions of this message have been removed]
Reply with quote
Send private message
Post new topic Reply to topic
Display posts from previous:   
 

All times are GMT
Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Freelace Website Designer - Customer web design and software building.
China Wholesale - Electronics Products
Character Studio - Tutorials and Help