Incorporating "Microsoft Office Web Components into an ASP.NET project

E

Eliezer

From an Excel "Expense Template", I chose the "Save as Web
Page" option which, of course, gave me a nice HTML page
that looks 95% like the original Excel sheet. I see that
this generated page is not simply a static HTML page, but
rather it has functionality to it, too: such as the Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an ASP.NET
project so I can use it as a template into which end-users
can input data and submit it via the web?


Thank you very much!
Eliezer
 
A

Alvin Bruney [MVP]

you can't. you will need to use the office web components instead. embed the
appropriate object in the asp.net page and the functionality of excel will
be provided. have a look at the office web components
 
E

Eliezer

Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some shorter
way to do it?

Thanks so very much!!!
Eliezer

-----Original Message-----
you can't. you will need to use the office web components instead. embed the
appropriate object in the asp.net page and the functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
From an Excel "Expense Template", I chose the "Save as Web
Page" option which, of course, gave me a nice HTML page
that looks 95% like the original Excel sheet. I see that
this generated page is not simply a static HTML page, but
rather it has functionality to it, too: such as the Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an ASP.NET
project so I can use it as a template into which end- users
can input data and submit it via the web?


Thank you very much!
Eliezer


.
 
A

Alvin Bruney [MVP]

nope,
you first need to download and install the office web components
http://tinyurl.com/cuxn the download contains sample help files to get you
started. You may also wish to download the office xp component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel spreadsheet component
to the toolbox and drop it on the design surface. Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop excel. Most of the
functionality is included.
You can have a look at this website for code snippets and applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some shorter
way to do it?

Thanks so very much!!!
Eliezer

-----Original Message-----
you can't. you will need to use the office web components instead. embed the
appropriate object in the asp.net page and the functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
From an Excel "Expense Template", I chose the "Save as Web
Page" option which, of course, gave me a nice HTML page
that looks 95% like the original Excel sheet. I see that
this generated page is not simply a static HTML page, but
rather it has functionality to it, too: such as the Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an ASP.NET
project so I can use it as a template into which end- users
can input data and submit it via the web?


Thank you very much!
Eliezer


.
 
E

Eliezer

Alvin,

You've been a truly wonderful help in getting me started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer


-----Original Message-----
nope,
you first need to download and install the office web components
http://tinyurl.com/cuxn the download contains sample help files to get you
started. You may also wish to download the office xp component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel spreadsheet component
to the toolbox and drop it on the design surface. Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop excel. Most of the
functionality is included.
You can have a look at this website for code snippets and applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some shorter
way to do it?

Thanks so very much!!!
Eliezer

-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
From an Excel "Expense Template", I chose the "Save as Web
Page" option which, of course, gave me a nice HTML page
that looks 95% like the original Excel sheet. I see that
this generated page is not simply a static HTML page, but
rather it has functionality to it, too: such as the Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an ASP.NET
project so I can use it as a template into which end- users
can input data and submit it via the web?


Thank you very much!
Eliezer
 
A

Alvin Bruney [MVP]

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?
the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web components\10\1033
or search your hard drive for owc*.chm
2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to be installed for
interactive use like what you are trying to do otherwise you will not be
able to enter data into the spreadsheet. owc11 requires office 2003 for
interactivity for the most part. This is explained in detail in the
helpfiles. Have a look at this link, it explains interactivity and
licensing. You need to be aware of those before you dive in:
http://support.microsoft.com/default.aspx?scid=kb;en-us;555075
3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

they don't show up by default, you would need to add them to the toolbox
from the menu. from the studio tools menu, choose add/remove toolbox
components. It brings up a dialog box for .net and com components. You
choose to browse, find the owc dll on disk and click ok. Depending on which
pane is opened in the toolbox in studio, the controls appear there. If you
don't see them, search all the panes. if this fails, paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-0000-C000-000000000046
style="width:49%;height:350"> said:
4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

You don't need to do anything. The component looks exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Alvin,

You've been a truly wonderful help in getting me started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer


-----Original Message-----
nope,
you first need to download and install the office web components
http://tinyurl.com/cuxn the download contains sample help files to get you
started. You may also wish to download the office xp component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel spreadsheet component
to the toolbox and drop it on the design surface. Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop excel. Most of the
functionality is included.
You can have a look at this website for code snippets and applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
From an Excel "Expense Template", I chose the "Save as
Web
Page" option which, of course, gave me a nice HTML page
that looks 95% like the original Excel sheet. I see
that
this generated page is not simply a static HTML page,
but
rather it has functionality to it, too: such as the
Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer
 
E

Eliezer

Thank you, Alvin - it's now on the toolbox. I used 9.0 as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer




-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?
the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web components\10\1033
or search your hard drive for owc*.chm
2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to be installed for
interactive use like what you are trying to do otherwise you will not be
able to enter data into the spreadsheet. owc11 requires office 2003 for
interactivity for the most part. This is explained in detail in the
helpfiles. Have a look at this link, it explains interactivity and
licensing. You need to be aware of those before you dive in:
http://support.microsoft.com/default.aspx?scid=kb;en- us;555075

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

they don't show up by default, you would need to add them to the toolbox
from the menu. from the studio tools menu, choose add/remove toolbox
components. It brings up a dialog box for .net and com components. You
choose to browse, find the owc dll on disk and click ok. Depending on which
pane is opened in the toolbox in studio, the controls appear there. If you
don't see them, search all the panes. if this fails, paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-0000- C000-000000000046
style="width:49%;height:350"> said:
4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

You don't need to do anything. The component looks exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

You've been a truly wonderful help in getting me started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer


-----Original Message-----
nope,
you first need to download and install the office web components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the office xp component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel spreadsheet component
to the toolbox and drop it on the design surface. Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop excel. Most of the
functionality is included.
You can have a look at this website for code snippets
and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
From an Excel "Expense Template", I chose the "Save as
Web
Page" option which, of course, gave me a nice HTML page
that looks 95% like the original Excel sheet. I see
that
this generated page is not simply a static HTML page,
but
rather it has functionality to it, too: such as the
Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.
 
A

Alvin Bruney [MVP]

hmmm,
owc9 is radically different from owc10 so the owc10 helpfiles will not help
you much. The owc9 comes with its own help file so you should search your
drive for it. It should be available on the install cd. there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not really hot on the code
but the idea should be the same. you load the spreadsheet like so from the
clientside (not codebehind) assuming your spreadsheet name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the help file for that.
I'm giving you some owc10 code, some of it should work. it should give you
an idea on how to proceed. This is all client side vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color = "DarkGray"

Intelisense does not work on the spreadsheet object in asp.net. If you drop
the spreadsheet on a windows forms, you will have intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported. Objects drawn around the
spreadsheet or embedded in the spreadsheet is not supported. Remember it is
a scaled down version of excel. You should buy david stearn's book. It's
possibly the only book out there dedicated to owc9. There are some excel and
access books which have a page or two devoted to the owc9. If you have a
barnes and noble bookstore near you, go browse it (Access and Ecel section)
there are a few code snippets here and there. I hate to tell you this but
you are really on your own to figure this out. There is slightly more than
zero documentation out there on the OWC components. That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Thank you, Alvin - it's now on the toolbox. I used 9.0 as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer




-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?
the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web components\10\1033
or search your hard drive for owc*.chm
2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to be installed for
interactive use like what you are trying to do otherwise you will not be
able to enter data into the spreadsheet. owc11 requires office 2003 for
interactivity for the most part. This is explained in detail in the
helpfiles. Have a look at this link, it explains interactivity and
licensing. You need to be aware of those before you dive in:
http://support.microsoft.com/default.aspx?scid=kb;en- us;555075

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

they don't show up by default, you would need to add them to the toolbox
from the menu. from the studio tools menu, choose add/remove toolbox
components. It brings up a dialog box for .net and com components. You
choose to browse, find the owc dll on disk and click ok. Depending on which
pane is opened in the toolbox in studio, the controls appear there. If you
don't see them, search all the panes. if this fails, paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-0000- C000-000000000046
style="width:49%;height:350"> said:
4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

You don't need to do anything. The component looks exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

You've been a truly wonderful help in getting me started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office web
components
http://tinyurl.com/cuxn the download contains sample help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop
excel. Most of the
functionality is included.
You can have a look at this website for code snippets and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
From an Excel "Expense Template", I chose the "Save as
Web
Page" option which, of course, gave me a nice HTML
page
that looks 95% like the original Excel sheet. I see
that
this generated page is not simply a static HTML page,
but
rather it has functionality to it, too: such as the
Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.
 
E

Eliezer

Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer


-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10 helpfiles will not help
you much. The owc9 comes with its own help file so you should search your
drive for it. It should be available on the install cd. there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not really hot on the code
but the idea should be the same. you load the spreadsheet like so from the
clientside (not codebehind) assuming your spreadsheet name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the help file for that.
I'm giving you some owc10 code, some of it should work. it should give you
an idea on how to proceed. This is all client side vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets (document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color = "DarkGray"

Intelisense does not work on the spreadsheet object in asp.net. If you drop
the spreadsheet on a windows forms, you will have intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported. Objects drawn around the
spreadsheet or embedded in the spreadsheet is not supported. Remember it is
a scaled down version of excel. You should buy david stearn's book. It's
possibly the only book out there dedicated to owc9. There are some excel and
access books which have a page or two devoted to the owc9. If you have a
barnes and noble bookstore near you, go browse it (Access and Ecel section)
there are a few code snippets here and there. I hate to tell you this but
you are really on your own to figure this out. There is slightly more than
zero documentation out there on the OWC components. That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Thank you, Alvin - it's now on the toolbox. I used 9.0 as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer




-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to be installed for
interactive use like what you are trying to do otherwise you will not be
able to enter data into the spreadsheet. owc11 requires office 2003 for
interactivity for the most part. This is explained in detail in the
helpfiles. Have a look at this link, it explains interactivity and
licensing. You need to be aware of those before you dive in:
us;555075

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose add/remove toolbox
components. It brings up a dialog box for .net and com components. You
choose to browse, find the owc dll on disk and click ok. Depending on which
pane is opened in the toolbox in studio, the controls appear there. If you
don't see them, search all the panes. if this fails, paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

You don't need to do anything. The component looks exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

You've been a truly wonderful help in getting me started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office web
components
http://tinyurl.com/cuxn the download contains sample help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop
excel. Most of the
functionality is included.
You can have a look at this website for code snippets and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice HTML
page
that looks 95% like the original Excel sheet. I see
that
this generated page is not simply a static HTML page,
but
rather it has functionality to it, too: such as the
Excel
icons that undo, sort, cut, paste, help etc. All that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.


.
 
A

Alvin Bruney [MVP]

yup.
if your users can go for 2003, then you are better off using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer


-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10 helpfiles will not help
you much. The owc9 comes with its own help file so you should search your
drive for it. It should be available on the install cd. there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not really hot on the code
but the idea should be the same. you load the spreadsheet like so from the
clientside (not codebehind) assuming your spreadsheet name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the help file for that.
I'm giving you some owc10 code, some of it should work. it should give you
an idea on how to proceed. This is all client side vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets (document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color = "DarkGray"

Intelisense does not work on the spreadsheet object in asp.net. If you drop
the spreadsheet on a windows forms, you will have intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported. Objects drawn around the
spreadsheet or embedded in the spreadsheet is not supported. Remember it is
a scaled down version of excel. You should buy david stearn's book. It's
possibly the only book out there dedicated to owc9. There are some excel and
access books which have a page or two devoted to the owc9. If you have a
barnes and noble bookstore near you, go browse it (Access and Ecel section)
there are a few code snippets here and there. I hate to tell you this but
you are really on your own to figure this out. There is slightly more than
zero documentation out there on the OWC components. That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Thank you, Alvin - it's now on the toolbox. I used 9.0 as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to
be installed for
interactive use like what you are trying to do otherwise
you will not be
able to enter data into the spreadsheet. owc11 requires
office 2003 for
interactivity for the most part. This is explained in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you dive
in:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them
so
they're usable from VS.NET?

they don't show up by default, you would need to add them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and com
components. You
choose to browse, find the owc dll on disk and click ok.
Depending on which
pane is opened in the toolbox in studio, the controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000- 0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office web
components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop
excel. Most of the
functionality is included.
You can have a look at this website for code snippets
and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
From an Excel "Expense Template", I chose the "Save
as
Web
Page" option which, of course, gave me a nice HTML
page
that looks 95% like the original Excel sheet. I see
that
this generated page is not simply a static HTML
page,
but
rather it has functionality to it, too: such as the
Excel
icons that undo, sort, cut, paste, help etc. All
that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.


.
 
E

Eliezer

Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer


-----Original Message-----
yup.
if your users can go for 2003, then you are better off using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer


-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10 helpfiles will not help
you much. The owc9 comes with its own help file so you should search your
drive for it. It should be available on the install cd. there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the help file for that.
I'm giving you some owc10 code, some of it should work. it should give you
an idea on how to proceed. This is all client side vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets (document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color = "DarkGray"

Intelisense does not work on the spreadsheet object in asp.net. If you drop
the spreadsheet on a windows forms, you will have intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported. Objects drawn around the
spreadsheet or embedded in the spreadsheet is not supported. Remember it is
a scaled down version of excel. You should buy david stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate to tell you this but
you are really on your own to figure this out. There is slightly more than
zero documentation out there on the OWC components. That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Thank you, Alvin - it's now on the toolbox. I used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to
be installed for
interactive use like what you are trying to do otherwise
you will not be
able to enter data into the spreadsheet. owc11 requires
office 2003 for
interactivity for the most part. This is explained in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you dive
in:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them
so
they're usable from VS.NET?

they don't show up by default, you would need to add them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and com
components. You
choose to browse, find the owc dll on disk and click ok.
Depending on which
pane is opened in the toolbox in studio, the controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000- 0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components" but
cannot find any help files installed with it. Where are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but don't
see any OWC on my VS.NET toolbar. How do I import them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in the
VS.NET designer until it looks the same or is there some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office web
components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop
excel. Most of the
functionality is included.
You can have a look at this website for code snippets
and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
From an Excel "Expense Template", I chose the "Save
as
Web
Page" option which, of course, gave me a nice HTML
page
that looks 95% like the original Excel sheet. I see
that
this generated page is not simply a static HTML
page,
but
rather it has functionality to it, too: such as the
Excel
icons that undo, sort, cut, paste, help etc. All
that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.


.
 
A

Alvin Bruney [MVP]

granted, documentation is a bit *sparse. The idea is to use the owc10
documentation to figure out owc11 since the architecture is *the same.
Really, you should settle on either owc10 or owc11. Owc9 should be last
resort. Owc10 requires office xp for interactive use. Runtime static use is
always free. owc11 requires office 2003 for interactivity. Runtime static
use is always free. Both owc10 and owc11 are available as separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer


-----Original Message-----
yup.
if your users can go for 2003, then you are better off using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so you
should search your
drive for it. It should be available on the install cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the
help file for that.
I'm giving you some owc10 code, some of it should work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9. There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it (Access
and Ecel section)
there are a few code snippets here and there. I hate to
tell you this but
you are really on your own to figure this out. There is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Thank you, Alvin - it's now on the toolbox. I used 9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how
to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp to
be installed for
interactive use like what you are trying to do otherwise
you will not be
able to enter data into the spreadsheet. owc11 requires
office 2003 for
interactivity for the most part. This is explained in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you dive
in:
http://support.microsoft.com/default.aspx?scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and com
components. You
choose to browse, find the owc dll on disk and click ok.
Depending on which
pane is opened in the toolbox in studio, the controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office web
components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop
excel. Most of the
functionality is included.
You can have a look at this website for code snippets
and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used
to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice HTML
page
that looks 95% like the original Excel sheet. I
see
that
this generated page is not simply a static HTML
page,
but
rather it has functionality to it, too: such as
the
Excel
icons that undo, sort, cut, paste, help etc. All
that
free functionality is super! But...

How do I take this page and incorporate it into an
ASP.NET
project so I can use it as a template into which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.


.
 
E

Eliezer

Alvin,

I have successfully added OWC 9.0 as a reference into my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer


-----Original Message-----
granted, documentation is a bit *sparse. The idea is to use the owc10
documentation to figure out owc11 since the architecture is *the same.
Really, you should settle on either owc10 or owc11. Owc9 should be last
resort. Owc10 requires office xp for interactive use. Runtime static use is
always free. owc11 requires office 2003 for interactivity. Runtime static
use is always free. Both owc10 and owc11 are available as separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer


-----Original Message-----
yup.
if your users can go for 2003, then you are better off using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so you
should search your
drive for it. It should be available on the install cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the
help file for that.
I'm giving you some owc10 code, some of it should work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9. There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it (Access
and Ecel section)
there are a few code snippets here and there. I hate to
tell you this but
you are really on your own to figure this out. There is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Thank you, Alvin - it's now on the toolbox. I used 9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked at
those help files you (correctly) gave me the path for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how
to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office
xp
to
be installed for
interactive use like what you are trying to do otherwise
you will not be
able to enter data into the spreadsheet. owc11 requires
office 2003 for
interactivity for the most part. This is explained in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you dive
in:
http://support.microsoft.com/default.aspx? scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and com
components. You
choose to browse, find the owc dll on disk and click ok.
Depending on which
pane is opened in the toolbox in studio, the controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office web
components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of desktop
excel. Most of the
functionality is included.
You can have a look at this website for code snippets
and
applications in
production using this object http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used
to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice HTML
page
that looks 95% like the original Excel sheet. I
see
that
this generated page is not simply a static HTML
page,
but
rather it has functionality to it, too: such as
the
Excel
icons that undo, sort, cut, paste, help etc. All
that
free functionality is super! But...

How do I take this page and incorporate it
into
an
ASP.NET
project so I can use it as a template into which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.


.
 
A

Alvin Bruney [MVP]

You can't. The owc is a client side activeX control. It does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory spreadsheet object. It is
not related to the client-side activeX control object. sorta like apples and
grapes. One can't talk to the other. If you want codebehind functionality,
you need to stick with the in-memory object. If you want client side
functionality, you stick with the object you dragged onto the spreadsheet.

make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Alvin,

I have successfully added OWC 9.0 as a reference into my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer


-----Original Message-----
granted, documentation is a bit *sparse. The idea is to use the owc10
documentation to figure out owc11 since the architecture is *the same.
Really, you should settle on either owc10 or owc11. Owc9 should be last
resort. Owc10 requires office xp for interactive use. Runtime static use is
always free. owc11 requires office 2003 for interactivity. Runtime static
use is always free. Both owc10 and owc11 are available as separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will
OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so you
should search your
drive for it. It should be available on the install cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the
help file for that.
I'm giving you some owc10 code, some of it should work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate to
tell you this but
you are really on your own to figure this out. There is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Thank you, Alvin - it's now on the toolbox. I used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked
at
those help files you (correctly) gave me the path
for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how
to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying
to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is explained in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you
dive
in:
http://support.microsoft.com/default.aspx? scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and com
components. You
choose to browse, find the owc dll on disk and click
ok.
Depending on which
pane is opened in the toolbox in studio, the controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office
web
components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the office xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the
excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used
to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice
HTML
page
that looks 95% like the original Excel sheet. I
see
that
this generated page is not simply a static HTML
page,
but
rather it has functionality to it, too: such as
the
Excel
icons that undo, sort, cut, paste, help etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it into
an
ASP.NET
project so I can use it as a template into which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.


.
 
E

Eliezer

Alvin,

I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...

This is what I've got working (or not working) currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All that
I've used the designer for is to drag my object onto it.
Nothing more.

Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client-side
control... Here's my question: Is there anyway at all to
communicate between my HTML page and my code-behind page?
In other words, once the user enters the number "7", let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?

If yes, how?

If it is NOT possible to communicate between my HTML page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?

If it is truly the case that they CANNOT communicate, then
this is an awful way to implement my solution. I want to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet solution?
Must I simply go and ignore OWC and just create my own GUI
using DataGrids, etc.?

Thank you once again VERY, VERY much!
Eliezer


-----Original Message-----
You can't. The owc is a client side activeX control. It does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory spreadsheet object. It is
not related to the client-side activeX control object. sorta like apples and
grapes. One can't talk to the other. If you want codebehind functionality,
you need to stick with the in-memory object. If you want client side
functionality, you stick with the object you dragged onto the spreadsheet.

make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I have successfully added OWC 9.0 as a reference into my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer


-----Original Message-----
granted, documentation is a bit *sparse. The idea is to use the owc10
documentation to figure out owc11 since the architecture is *the same.
Really, you should settle on either owc10 or owc11. Owc9 should be last
resort. Owc10 requires office xp for interactive use. Runtime static use is
always free. owc11 requires office 2003 for interactivity. Runtime static
use is always free. Both owc10 and owc11 are available
as
separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will
OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so you
should search your
drive for it. It should be available on the install cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need the
help file for that.
I'm giving you some owc10 code, some of it should work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range ("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate to
tell you this but
you are really on your own to figure this out. There is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Thank you, Alvin - it's now on the toolbox. I used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked
at
those help files you (correctly) gave me the path
for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples how
to
do *anything* with this object in VS.NET? Some sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear on
previously: How do I get this spreadsheet looking the
same as the *specific* Excel object which I am trying
to
mimic? i.e. my company's logo on the sheet, the right
colors for various rows, and shapes drawn around parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is explained in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you
dive
in:
http://support.microsoft.com/default.aspx? scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and com
components. You
choose to browse, find the owc dll on disk and click
ok.
Depending on which
pane is opened in the toolbox in studio, the controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551- 0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web Components"
but
cannot find any help files installed with it. Where
are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office
web
components
http://tinyurl.com/cuxn the download contains sample
help
files to get you
started. You may also wish to download the
office
xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the
excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's used
to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice
HTML
page
that looks 95% like the original Excel sheet. I
see
that
this generated page is not simply a static HTML
page,
but
rather it has functionality to it, too:
such
as
the
Excel
icons that undo, sort, cut, paste, help etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it into
an
ASP.NET
project so I can use it as a template into which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.




.


.
 
A

Alvin Bruney [MVP]

You aren't bothering. For every question I answer microsoft pays me a
healthy fee.

There are a couple ways around it
Either post the data to server.
Or unload the data into a server control.

Here is option two.

//clientside script - usually in the page_unload function
TextBox1.Text = sp.CSVDATA;


//in your code behind
string EachRowVal[] = TexBox1.Text.Spli(Environment.Newline);

string EachColVal[] = TexBox1.Text.Split(',');

You can then loop thru the rows and columns to get your values

The issue here is that you have no way of knowing which values were changed,
but that's a story for another day.

the opening line was a joke by the way. ms does not pay its mvp's. i
bothered a lot of people to know this stuff so fire away. i'll do my
penance.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Alvin,

I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...

This is what I've got working (or not working) currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All that
I've used the designer for is to drag my object onto it.
Nothing more.

Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client-side
control... Here's my question: Is there anyway at all to
communicate between my HTML page and my code-behind page?
In other words, once the user enters the number "7", let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?

If yes, how?

If it is NOT possible to communicate between my HTML page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?

If it is truly the case that they CANNOT communicate, then
this is an awful way to implement my solution. I want to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet solution?
Must I simply go and ignore OWC and just create my own GUI
using DataGrids, etc.?

Thank you once again VERY, VERY much!
Eliezer


-----Original Message-----
You can't. The owc is a client side activeX control. It does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory spreadsheet object. It is
not related to the client-side activeX control object. sorta like apples and
grapes. One can't talk to the other. If you want codebehind functionality,
you need to stick with the in-memory object. If you want client side
functionality, you stick with the object you dragged onto the spreadsheet.

make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I have successfully added OWC 9.0 as a reference into my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer



-----Original Message-----
granted, documentation is a bit *sparse. The idea is to
use the owc10
documentation to figure out owc11 since the architecture
is *the same.
Really, you should settle on either owc10 or owc11. Owc9
should be last
resort. Owc10 requires office xp for interactive use.
Runtime static use is
always free. owc11 requires office 2003 for
interactivity. Runtime static
use is always free. Both owc10 and owc11 are available as
separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will
OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so you
should search your
drive for it. It should be available on the install
cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need
the
help file for that.
I'm giving you some owc10 code, some of it should
work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range ("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate
to
tell you this but
you are really on your own to figure this out. There
is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Thank you, Alvin - it's now on the toolbox. I used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked
at
those help files you (correctly) gave me the path
for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples
how
to
do *anything* with this object in VS.NET? Some
sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear
on
previously: How do I get this spreadsheet looking
the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the
right
colors for various rows, and shapes drawn around
parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office
xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is explained
in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you
dive
in:
http://support.microsoft.com/default.aspx?
scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and
com
components. You
choose to browse, find the owc dll on disk and click
ok.
Depending on which
pane is opened in the toolbox in studio, the
controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551- 0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office
web
components
http://tinyurl.com/cuxn the download contains
sample
help
files to get you
started. You may also wish to download the office
xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the
excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's
used
to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there
some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice
HTML
page
that looks 95% like the original Excel
sheet. I
see
that
this generated page is not simply a static
HTML
page,
but
rather it has functionality to it, too: such
as
the
Excel
icons that undo, sort, cut, paste, help etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it
into
an
ASP.NET
project so I can use it as a template into
which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.




.


.
 
E

Eliezer

If MS would pay you for each question you answered, I'd
make you rich quick! :)

I don't understand option #2. Perhaps I should provide a
few more details: My endusers will be pulling up this
Excel object (OWC or otherwise) - with no real data in it;
it's just a template. So it's got headers and some
formatting in it. But as far as numbers go - none. So
determining what data has changed will be a *non*-issue:
any info in almost all of the cells will be guaranteed to
be changed/new.

So...

Could you please explain what exactly is going on
in "option #2"? You are declaring an array and populating
it with *what* exactly?... How does that overcome the
problem of having the client object communicate with the
server object? Should I have a spreadsheet object on my
designer?

Kindly explain - the more the better :)

Eliezer


-----Original Message-----
You aren't bothering. For every question I answer microsoft pays me a
healthy fee.

There are a couple ways around it
Either post the data to server.
Or unload the data into a server control.

Here is option two.

//clientside script - usually in the page_unload function
TextBox1.Text = sp.CSVDATA;


//in your code behind
string EachRowVal[] = TexBox1.Text.Spli (Environment.Newline);

string EachColVal[] = TexBox1.Text.Split(',');

You can then loop thru the rows and columns to get your values

The issue here is that you have no way of knowing which values were changed,
but that's a story for another day.

the opening line was a joke by the way. ms does not pay its mvp's. i
bothered a lot of people to know this stuff so fire away. i'll do my
penance.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...

This is what I've got working (or not working) currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All that
I've used the designer for is to drag my object onto it.
Nothing more.

Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client- side
control... Here's my question: Is there anyway at all to
communicate between my HTML page and my code-behind page?
In other words, once the user enters the number "7", let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?

If yes, how?

If it is NOT possible to communicate between my HTML page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?

If it is truly the case that they CANNOT communicate, then
this is an awful way to implement my solution. I want to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet solution?
Must I simply go and ignore OWC and just create my own GUI
using DataGrids, etc.?

Thank you once again VERY, VERY much!
Eliezer


-----Original Message-----
You can't. The owc is a client side activeX control. It does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory spreadsheet object. It is
not related to the client-side activeX control object. sorta like apples and
grapes. One can't talk to the other. If you want codebehind functionality,
you need to stick with the in-memory object. If you want client side
functionality, you stick with the object you dragged
onto
the spreadsheet.
make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I have successfully added OWC 9.0 as a reference into my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer



-----Original Message-----
granted, documentation is a bit *sparse. The idea is to
use the owc10
documentation to figure out owc11 since the architecture
is *the same.
Really, you should settle on either owc10 or owc11. Owc9
should be last
resort. Owc10 requires office xp for interactive use.
Runtime static use is
always free. owc11 requires office 2003 for
interactivity. Runtime static
use is always free. Both owc10 and owc11 are available as
separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

This is ridiculous - I can't find any information about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003, will
OWC
10.0 do what I need it to do with VS.NET, codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so you
should search your
drive for it. It should be available on the install
cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need
the
help file for that.
I'm giving you some owc10 code, some of it should
work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range ("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet
object
in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate
to
tell you this but
you are really on your own to figure this out. There
is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Thank you, Alvin - it's now on the toolbox. I used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with that
pretty spreadsheet on my design surface... I looked
at
those help files you (correctly) gave me the path
for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples
how
to
do *anything* with this object in VS.NET? Some
sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear
on
previously: How do I get this spreadsheet looking
the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the
right
colors for various rows, and shapes drawn around
parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a problem?
probably. what will your users be using? There are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office
xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is explained
in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before you
dive
in:
http://support.microsoft.com/default.aspx?
scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and
com
components. You
choose to browse, find the owc dll on disk and click
ok.
Depending on which
pane is opened in the toolbox in studio, the
controls
appear there. If you
don't see them, search all the panes. if this fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551- 0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

2) I have Office 2000, not XP - is that a problem?

3) I added a reference to my ASP.NET project, but
don't
see any OWC on my VS.NET toolbar. How do I import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the office
web
components
http://tinyurl.com/cuxn the download contains
sample
help
files to get you
started. You may also wish to download the office
xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the
excel
spreadsheet component
to the toolbox and drop it on the design surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object" into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's
used
to
already - do I just play with that object in the
VS.NET
designer until it looks the same or is there
some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
[email protected]...
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a nice
HTML
page
that looks 95% like the original Excel
sheet. I
see
that
this generated page is not simply a static
HTML
page,
but
rather it has functionality to it, too: such
as
the
Excel
icons that undo, sort, cut, paste, help etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it
into
an
ASP.NET
project so I can use it as a template into
which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.




.



.


.
 
A

Alvin Bruney [MVP]

I assume you are going to do something with the data on the server right?
You have an owc excel object on your designer. This is rendered client-side.
The assumption here is that your users will enter data in the webpage, and
you want to process that data on the server. Is this a correct assumption?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
If MS would pay you for each question you answered, I'd
make you rich quick! :)

I don't understand option #2. Perhaps I should provide a
few more details: My endusers will be pulling up this
Excel object (OWC or otherwise) - with no real data in it;
it's just a template. So it's got headers and some
formatting in it. But as far as numbers go - none. So
determining what data has changed will be a *non*-issue:
any info in almost all of the cells will be guaranteed to
be changed/new.

So...

Could you please explain what exactly is going on
in "option #2"? You are declaring an array and populating
it with *what* exactly?... How does that overcome the
problem of having the client object communicate with the
server object? Should I have a spreadsheet object on my
designer?

Kindly explain - the more the better :)

Eliezer


-----Original Message-----
You aren't bothering. For every question I answer microsoft pays me a
healthy fee.

There are a couple ways around it
Either post the data to server.
Or unload the data into a server control.

Here is option two.

//clientside script - usually in the page_unload function
TextBox1.Text = sp.CSVDATA;


//in your code behind
string EachRowVal[] = TexBox1.Text.Spli (Environment.Newline);

string EachColVal[] = TexBox1.Text.Split(',');

You can then loop thru the rows and columns to get your values

The issue here is that you have no way of knowing which values were changed,
but that's a story for another day.

the opening line was a joke by the way. ms does not pay its mvp's. i
bothered a lot of people to know this stuff so fire away. i'll do my
penance.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...

This is what I've got working (or not working) currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All that
I've used the designer for is to drag my object onto it.
Nothing more.

Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client- side
control... Here's my question: Is there anyway at all to
communicate between my HTML page and my code-behind page?
In other words, once the user enters the number "7", let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?

If yes, how?

If it is NOT possible to communicate between my HTML page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?

If it is truly the case that they CANNOT communicate, then
this is an awful way to implement my solution. I want to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet solution?
Must I simply go and ignore OWC and just create my own GUI
using DataGrids, etc.?

Thank you once again VERY, VERY much!
Eliezer



-----Original Message-----
You can't. The owc is a client side activeX control. It
does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory
spreadsheet object. It is
not related to the client-side activeX control object.
sorta like apples and
grapes. One can't talk to the other. If you want
codebehind functionality,
you need to stick with the in-memory object. If you want
client side
functionality, you stick with the object you dragged onto
the spreadsheet.

make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

I have successfully added OWC 9.0 as a reference into my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I
am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to
name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet
onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer



-----Original Message-----
granted, documentation is a bit *sparse. The idea is to
use the owc10
documentation to figure out owc11 since the architecture
is *the same.
Really, you should settle on either owc10 or owc11. Owc9
should be last
resort. Owc10 requires office xp for interactive use.
Runtime static use is
always free. owc11 requires office 2003 for
interactivity. Runtime static
use is always free. Both owc10 and owc11 are available
as
separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

This is ridiculous - I can't find any information
about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to
use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003,
will
OWC
10.0 do what I need it to do with VS.NET,
codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so
you
should search your
drive for it. It should be available on the install
cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your
spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need
the
help file for that.
I'm giving you some owc10 code, some of it should
work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range
("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object
in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate
to
tell you this but
you are really on your own to figure this out. There
is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Thank you, Alvin - it's now on the toolbox. I
used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with
that
pretty spreadsheet on my design surface... I
looked
at
those help files you (correctly) gave me the path
for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples
how
to
do *anything* with this object in VS.NET? Some
sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear
on
previously: How do I get this spreadsheet looking
the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the
right
colors for various rows, and shapes drawn around
parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a
problem?
probably. what will your users be using? There are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office
xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is explained
in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before
you
dive
in:
http://support.microsoft.com/default.aspx?
scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to
add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and
com
components. You
choose to browse, find the owc dll on disk and
click
ok.
Depending on which
pane is opened in the toolbox in studio, the
controls
appear there. If you
don't see them, search all the panes. if this
fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-
0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin,

You've been a truly wonderful help in getting me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

2) I have Office 2000, not XP - is that a
problem?

3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the
office
web
components
http://tinyurl.com/cuxn the download contains
sample
help
files to get you
started. You may also wish to download the
office
xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the
excel
spreadsheet component
to the toolbox and drop it on the design
surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object"
into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out
there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's
used
to
already - do I just play with that object in
the
VS.NET
designer until it looks the same or is there
some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
<[email protected]>
wrote
in
message
[email protected]...
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a
nice
HTML
page
that looks 95% like the original Excel
sheet. I
see
that
this generated page is not simply a static
HTML
page,
but
rather it has functionality to it, too:
such
as
the
Excel
icons that undo, sort, cut, paste, help etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it
into
an
ASP.NET
project so I can use it as a template into
which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.




.



.


.
 
E

Eliezer

Yes, that is all precisely correct.
Eliezer

-----Original Message-----
I assume you are going to do something with the data on the server right?
You have an owc excel object on your designer. This is rendered client-side.
The assumption here is that your users will enter data in the webpage, and
you want to process that data on the server. Is this a correct assumption?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
If MS would pay you for each question you answered, I'd
make you rich quick! :)

I don't understand option #2. Perhaps I should provide a
few more details: My endusers will be pulling up this
Excel object (OWC or otherwise) - with no real data in it;
it's just a template. So it's got headers and some
formatting in it. But as far as numbers go - none. So
determining what data has changed will be a *non*-issue:
any info in almost all of the cells will be guaranteed to
be changed/new.

So...

Could you please explain what exactly is going on
in "option #2"? You are declaring an array and populating
it with *what* exactly?... How does that overcome the
problem of having the client object communicate with the
server object? Should I have a spreadsheet object on my
designer?

Kindly explain - the more the better :)

Eliezer


-----Original Message-----
You aren't bothering. For every question I answer microsoft pays me a
healthy fee.

There are a couple ways around it
Either post the data to server.
Or unload the data into a server control.

Here is option two.

//clientside script - usually in the page_unload function
TextBox1.Text = sp.CSVDATA;


//in your code behind
string EachRowVal[] = TexBox1.Text.Spli (Environment.Newline);

string EachColVal[] = TexBox1.Text.Split(',');

You can then loop thru the rows and columns to get your values

The issue here is that you have no way of knowing which values were changed,
but that's a story for another day.

the opening line was a joke by the way. ms does not pay its mvp's. i
bothered a lot of people to know this stuff so fire
away.
i'll do my
penance.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Alvin,

I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...

This is what I've got working (or not working) currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All that
I've used the designer for is to drag my object onto it.
Nothing more.

Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client- side
control... Here's my question: Is there anyway at
all
to
communicate between my HTML page and my code-behind page?
In other words, once the user enters the number "7", let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?

If yes, how?

If it is NOT possible to communicate between my HTML page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?

If it is truly the case that they CANNOT communicate, then
this is an awful way to implement my solution. I want to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet solution?
Must I simply go and ignore OWC and just create my own GUI
using DataGrids, etc.?

Thank you once again VERY, VERY much!
Eliezer



-----Original Message-----
You can't. The owc is a client side activeX control. It
does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory
spreadsheet object. It is
not related to the client-side activeX control object.
sorta like apples and
grapes. One can't talk to the other. If you want
codebehind functionality,
you need to stick with the in-memory object. If you want
client side
functionality, you stick with the object you dragged onto
the spreadsheet.

make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

I have successfully added OWC 9.0 as a reference
into
my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I
am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to
name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet
onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the
codebehind
to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer



-----Original Message-----
granted, documentation is a bit *sparse. The idea is to
use the owc10
documentation to figure out owc11 since the architecture
is *the same.
Really, you should settle on either owc10 or owc11. Owc9
should be last
resort. Owc10 requires office xp for interactive use.
Runtime static use is
always free. owc11 requires office 2003 for
interactivity. Runtime static
use is always free. Both owc10 and owc11 are available
as
separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin,

This is ridiculous - I can't find any information
about
anything on this topic...

OK, let's say I can go with Office 2003 for my users.
Where do I get OWC 11.0 and where can I learn how to
use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003,
will
OWC
10.0 do what I need it to do with VS.NET,
codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the owc10
helpfiles will not help
you much. The owc9 comes with its own help file so
you
should search your
drive for it. It should be available on the install
cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your
spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will need
the
help file for that.
I'm giving you some owc10 code, some of it should
work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter= true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range
("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet object
in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy david
stearn's book. It's
possibly the only book out there dedicated to owc9.
There
are some excel and
access books which have a page or two devoted to the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I hate
to
tell you this but
you are really on your own to figure this out. There
is
slightly more than
zero documentation out there on the OWC components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Thank you, Alvin - it's now on the toolbox. I
used
9.0
as
myself and my users all have Office 2000. But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with
that
pretty spreadsheet on my design surface... I
looked
at
those help files you (correctly) gave me the path
for -
but they aren't so helpful for how do get started
in .NET/VS.NET... Any other tutorials or examples
how
to
do *anything* with this object in VS.NET? Some
sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't clear
on
previously: How do I get this spreadsheet looking
the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the
right
colors for various rows, and shapes drawn around
parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a
problem?
probably. what will your users be using? There are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires office
xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is explained
in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before
you
dive
in:
http://support.microsoft.com/default.aspx?
scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to
add
them
to the toolbox
from the menu. from the studio tools menu, choose
add/remove toolbox
components. It brings up a dialog box for .net and
com
components. You
choose to browse, find the owc dll on disk and
click
ok.
Depending on which
pane is opened in the toolbox in studio, the
controls
appear there. If you
don't see them, search all the panes. if this
fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-
0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

You don't need to do anything. The component looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
Alvin,

You've been a truly wonderful help in
getting
me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

2) I have Office 2000, not XP - is that a
problem?

3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the
office
web
components
http://tinyurl.com/cuxn the download contains
sample
help
files to get you
started. You may also wish to download the
office
xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add the
excel
spreadsheet component
to the toolbox and drop it on the design
surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
[email protected]...
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object"
into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out
there?
How do I get it looking the same as the Excel
spreadsheet
format (with logo, colors, etc) as everyone's
used
to
already - do I just play with that object in
the
VS.NET
designer until it looks the same or is there
some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office web
components
instead. embed the
appropriate object in the asp.net page and the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
<[email protected]>
wrote
in
message
[email protected]...
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a
nice
HTML
page
that looks 95% like the original Excel
sheet. I
see
that
this generated page is not simply a static
HTML
page,
but
rather it has functionality to it, too:
such
as
the
Excel
icons that undo, sort, cut, paste, help etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it
into
an
ASP.NET
project so I can use it as a template into
which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.




.



.



.


.
 
A

Alvin Bruney [MVP]

good.
so there are two sides to the equation. one part happens on the client, the
other happens on the server.

This is the client part.
If you drag an excel spreadsheet onto a form, it is programmatically
accessible from the client-side. It is not accessible from the server.
When you run the app, it appears in the webpage clientside. A user now
enters data into the spreadsheet. Put another button on the form. This will
be your save button. It is responsible for getting the data from the client
to the server. Put a text box on the form as well. Set its visible property
to false. In your page_load event map the onclick to allow the excel
spreadsheet to unload its data into the textbox. This is the code:

if(!Page.IsPostBack)
button1.Attributes.Add("onclick","TextBox1.Text =
spreadsheet1.CSVDATA");

Although this code is in the code behind, it executes on the client when the
button is clicked before it calls the server side code.

Server side part
Here, you will test the server side textbox to see if it contains data on
every post. This code goes in your page_load.
if(TextBox1.Text.Trim() != string.empty)
put the processing code i posted earlier here,
followed by
TextBox1.Text = string.empty;

The logic is as follows: if the user enters data in the spreadsheet and
clicks the save button,
the button will cause a postback. Before the postback occurs, the
spreadsheet will unload its data into the serverside textbox control. The
postback will naturally cause the page_load function to be called.
Everytime, the function fires, you check the textbox to see if it contains
data. If it contains data, you process it and then clear it. Otherwise you
ignore the empty textbox. I already gave you the processing code which will
extract each row in the spreadsheet.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Eliezer said:
Yes, that is all precisely correct.
Eliezer

-----Original Message-----
I assume you are going to do something with the data on the server right?
You have an owc excel object on your designer. This is rendered client-side.
The assumption here is that your users will enter data in the webpage, and
you want to process that data on the server. Is this a correct assumption?

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
If MS would pay you for each question you answered, I'd
make you rich quick! :)

I don't understand option #2. Perhaps I should provide a
few more details: My endusers will be pulling up this
Excel object (OWC or otherwise) - with no real data in it;
it's just a template. So it's got headers and some
formatting in it. But as far as numbers go - none. So
determining what data has changed will be a *non*-issue:
any info in almost all of the cells will be guaranteed to
be changed/new.

So...

Could you please explain what exactly is going on
in "option #2"? You are declaring an array and populating
it with *what* exactly?... How does that overcome the
problem of having the client object communicate with the
server object? Should I have a spreadsheet object on my
designer?

Kindly explain - the more the better :)

Eliezer



-----Original Message-----
You aren't bothering. For every question I answer
microsoft pays me a
healthy fee.

There are a couple ways around it
Either post the data to server.
Or unload the data into a server control.

Here is option two.

//clientside script - usually in the page_unload function
TextBox1.Text = sp.CSVDATA;


//in your code behind
string EachRowVal[] = TexBox1.Text.Spli
(Environment.Newline);

string EachColVal[] = TexBox1.Text.Split(',');

You can then loop thru the rows and columns to get your
values

The issue here is that you have no way of knowing which
values were changed,
but that's a story for another day.

the opening line was a joke by the way. ms does not pay
its mvp's. i
bothered a lot of people to know this stuff so fire away.
i'll do my
penance.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

I'm sorry to bother you again - but, as we both realize,
there aren't too many places to turn on this subject for
some (very strange) reason...

This is what I've got working (or not working)
currently:
Using VS.NET, I dragged a "Microsoft Office Spreadsheet
9.0" onto the designer. Modeling after the code you
shared with me (below), I populated a few cells in that
object using VBScript embedded in my HTML page. All
that
I've used the designer for is to drag my object onto it.
Nothing more.

Bearing in mind that which you wrote in your last post,
that one is a server-side control and one is a client-
side
control... Here's my question: Is there anyway at all
to
communicate between my HTML page and my code-behind
page?
In other words, once the user enters the number "7",
let's
say, in cell "A3", can I grab that value in the code-
behind and process it in VB.NET?

If yes, how?

If it is NOT possible to communicate between my HTML
page
and my code-behind page, so then am I merely writing a
pure HTML page (with some VBScript embedded within it)
using VS.NET as a fancy text-editor? Can I really not
write any genuine VB.NET code for use with this Office
Spreadsheet object?

If it is truly the case that they CANNOT communicate,
then
this is an awful way to implement my solution. I want
to
write my solution in VB.NET, not HTML/VBScript... What,
then, is a "normal" way to create this intranet
solution?
Must I simply go and ignore OWC and just create my own
GUI
using DataGrids, etc.?

Thank you once again VERY, VERY much!
Eliezer



-----Original Message-----
You can't. The owc is a client side activeX control. It
does not live on the
server so there is no way to access it on the server.

The code you have shown below is for the in-memory
spreadsheet object. It is
not related to the client-side activeX control object.
sorta like apples and
grapes. One can't talk to the other. If you want
codebehind functionality,
you need to stick with the in-memory object. If you want
client side
functionality, you stick with the object you dragged
onto
the spreadsheet.

make sense?
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
message
Alvin,

I have successfully added OWC 9.0 as a reference into
my
ASP.NET project. I have the following code:

Private Sub Page_Load(ByVal sender As
System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim ow As New OWC.SpreadsheetClass
ow.Range("A1", "A2").Select()
ow.Selection.Value = "22"
End Sub

Intelisense works(!) for the OWC 9.0 spreadsheet and I
am
able to drag a Spreadsheet object onto the design
surface. That's all very good.

The problem is that I can't seem to figure out how to
name
the objects so that the designer connects to my
codebehind. In other words, I can drag a spreadsheet
onto
the designer surface - set its ID and NAME to "ow" (I
don't know which is the proper attribute to be using -
"name" or "id") - and then in the code I refer to an
object as "ow" - yet my "ow" code doesn't at all
effect
my "ow" designer object.

PLEASE HELP: How can I get my code in the codebehind
to
manipulate/effect the object in the designer?

Thanks so much!
Eliezer



-----Original Message-----
granted, documentation is a bit *sparse. The idea is
to
use the owc10
documentation to figure out owc11 since the
architecture
is *the same.
Really, you should settle on either owc10 or owc11.
Owc9
should be last
resort. Owc10 requires office xp for interactive use.
Runtime static use is
always free. owc11 requires office 2003 for
interactivity. Runtime static
use is always free. Both owc10 and owc11 are available
as
separate downloads
or available on the office install cd.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
in
message
Alvin,

This is ridiculous - I can't find any information
about
anything on this topic...

OK, let's say I can go with Office 2003 for my
users.
Where do I get OWC 11.0 and where can I learn how to
use
it with VS.NET?

Thanks!
Eliezer



-----Original Message-----
yup.
if your users can go for 2003, then you are better
off
using owc11 since it
is the latest and greatest.
Still owc10 will suffice nicely as well.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Alvin, you're terrific!

If I'm able to move my users over to Office 2003,
will
OWC
10.0 do what I need it to do with VS.NET,
codebehind,
Intelisense, etc?

Thanks again!!!
Eliezer



-----Original Message-----
hmmm,
owc9 is radically different from owc10 so the
owc10
helpfiles will not help
you much. The owc9 comes with its own help file so
you
should search your
drive for it. It should be available on the
install
cd.
there is no download
currently on the web for the owc9.

I haven't played with owc9 in a few years so i'm
not
really hot on the code
but the idea should be the same. you load the
spreadsheet
like so from the
clientside (not codebehind) assuming your
spreadsheet
name is sp

sp.CSVDATA = "1,2,3,4,5";
to color the cells, format numbers etc you will
need
the
help file for that.
I'm giving you some owc10 code, some of it should
work.
it should give you
an idea on how to proceed. This is all client side
vbscript by the way.

'Delete locked rows from spreadsheet
Sub DeleteRow()
set shtCurrent = document.all.sp.ActiveSheet
saveProtection = shtCurrent.Protection.Enabled
shtCurrent.Protection.Enabled = false
document.all.sp.ActiveCell.EntireRow.Delete
shtCurrent.Protection.Enabled = saveProtection
End Sub

'height and width adjustments
document.all.sp.style.HEIGHT= 272
document.all.sp.style.WIDTH = 930

'sheet protection and button customization
document.all.sp.Columns(1).Hidden = true
Set ptProtSheet =
document.all.sp.Worksheets
(document.all.sp.ActiveSheet.Name).Protection
ptProtSheet.AllowFiltering = true
ptProtSheet.AllowSorting = false
document.all.sp.ActiveSheet.EnableAutoFilter=
true
document.all.sp.ActiveWindow.EnableResize = false

'hide columns
document.all.sp.Columns(2).Hidden = true
document.all.sp.Columns(3).Hidden = true
document.all.sp.Columns(5).Hidden = true

'lock columns
document.all.sp.Columns(2).Locked = true

'color range
document.all.sp.Range
("$A$1:$Z$2000").Interior.Color
= "DarkGray"

Intelisense does not work on the spreadsheet
object
in
asp.net. If you drop
the spreadsheet on a windows forms, you will have
intellisense, or you can
use the object browser to figure some of it out.

Your company's logo customization is not
supported.
Objects drawn around the
spreadsheet or embedded in the spreadsheet is not
supported. Remember it is
a scaled down version of excel. You should buy
david
stearn's book. It's
possibly the only book out there dedicated to
owc9.
There
are some excel and
access books which have a page or two devoted to
the
owc9. If you have a
barnes and noble bookstore near you, go browse it
(Access
and Ecel section)
there are a few code snippets here and there. I
hate
to
tell you this but
you are really on your own to figure this out.
There
is
slightly more than
zero documentation out there on the OWC
components.
That's changing for the
better very slowly.

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer" <[email protected]>
wrote
in
message
Thank you, Alvin - it's now on the toolbox. I
used
9.0
as
myself and my users all have Office 2000.
But...

1) Does VS.NET Intelisense work with the MSEXcel
Spreadsheet 9.0 object?

2) I can't figure out how to do *anything* with
that
pretty spreadsheet on my design surface... I
looked
at
those help files you (correctly) gave me the
path
for -
but they aren't so helpful for how do get
started
in .NET/VS.NET... Any other tutorials or
examples
how
to
do *anything* with this object in VS.NET? Some
sample
VB.NET syntax, perhaps?

3) Let me rephrase a question which I wasn't
clear
on
previously: How do I get this spreadsheet
looking
the
same as the *specific* Excel object which I am
trying
to
mimic? i.e. my company's logo on the sheet, the
right
colors for various rows, and shapes drawn around
parts
of
the spreadsheet for "pretty formatting"?

Thank you very much,
Eliezer





-----Original Message-----
1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

the default installation path for owc10 is
c:\programfiles\common files\microsoft
shared\web
components\10\1033
or search your hard drive for owc*.chm

2) I have Office 2000, not XP - is that a
problem?
probably. what will your users be using? There
are
three
versions of owc.
owc9 requires office
2000 to be installed period. owc10 requires
office
xp
to
be installed for
interactive use like what you are trying to do
otherwise
you will not be
able to enter data into the spreadsheet. owc11
requires
office 2003 for
interactivity for the most part. This is
explained
in
detail in the
helpfiles. Have a look at this link, it explains
interactivity and
licensing. You need to be aware of those before
you
dive
in:
http://support.microsoft.com/default.aspx?
scid=kb;en-
us;555075

3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?

they don't show up by default, you would need to
add
them
to the toolbox
from the menu. from the studio tools menu,
choose
add/remove toolbox
components. It brings up a dialog box for .net
and
com
components. You
choose to browse, find the owc dll on disk and
click
ok.
Depending on which
pane is opened in the toolbox in studio, the
controls
appear there. If you
don't see them, search all the panes. if this
fails,
paste this into your
html/aspx page inside the form tag

<object id=Spreadsheet1 classid=CLSID:0002E551-
0000-
0000-
C000-000000000046
style="width:49%;height:350"></object>

4) How do I get it looking the same as the
Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

You don't need to do anything. The component
looks
exactly like excel. right
down to the spinning logo.
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
wrote
in
message
Alvin,

You've been a truly wonderful help in getting
me
started.
I'm afraid I still don't "got it"...

1) I downloaded the "Office XP Tool: Web
Components"
but
cannot find any help files installed with it.
Where
are
they?

2) I have Office 2000, not XP - is that a
problem?

3) I added a reference to my ASP.NET project,
but
don't
see any OWC on my VS.NET toolbar. How do I
import
them
so
they're usable from VS.NET?

4) How do I get it looking the same as the
Excel
spreadsheet format (with logo, colors, etc) as
everyone's
used to already - do I just play with that
object
in
the
VS.NET designer until it looks the same or is
there
some
shorter way to do it?

Thanks again!
Eliezer



-----Original Message-----
nope,
you first need to download and install the
office
web
components
http://tinyurl.com/cuxn the download contains
sample
help
files to get you
started. You may also wish to download the
office
xp
component toolpack with
further examples and snippets.

If you are using visual studio, you can add
the
excel
spreadsheet component
to the toolbox and drop it on the design
surface.
Otherwise, you will need
to use the CLSID inside the html/apsx page.

The excel object is the same look and feel of
desktop
excel. Most of the
functionality is included.
You can have a look at this website for code
snippets
and
applications in
production using this object
http://tinyurl.com/27cok

--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
<[email protected]>
wrote
in
message
[email protected]...
Alvin, thanks so much for your quick reply!

*How* do I embed the "appropriate object"
into a
ASP.NET
form?
What is the name of that object?
Is there a good help file or tutorial out
there?
How do I get it looking the same as the
Excel
spreadsheet
format (with logo, colors, etc) as
everyone's
used
to
already - do I just play with that object in
the
VS.NET
designer until it looks the same or is there
some
shorter
way to do it?

Thanks so very much!!!
Eliezer


-----Original Message-----
you can't. you will need to use the office
web
components
instead. embed the
appropriate object in the asp.net page and
the
functionality of excel will
be provided. have a look at the office web
components

--
Regards,
Alvin Bruney
[ASP.NET MVP

http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"Eliezer"
<[email protected]>
wrote
in
message
[email protected]...
From an Excel "Expense Template", I chose
the "Save
as
Web
Page" option which, of course, gave me a
nice
HTML
page
that looks 95% like the original Excel
sheet. I
see
that
this generated page is not simply a static
HTML
page,
but
rather it has functionality to it, too:
such
as
the
Excel
icons that undo, sort, cut, paste, help
etc.
All
that
free functionality is super! But...

How do I take this page and incorporate it
into
an
ASP.NET
project so I can use it as a template into
which
end-
users
can input data and submit it via the web?


Thank you very much!
Eliezer


.



.



.




.



.



.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top