Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 2
Default Create Excel Worksheet in C# / VB

I create an Excel worksheet in C# (should be similar in VB)

Connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

Create string:
"CREATE TABLE S1 (Dt date, St char(40), Cr currency)"

Works fine, but the worksheet is named _S1 (UNDERSCORE!) and not S1.
Why does this happen? Any ideas?

Thx HW
  #2   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 2
Default Create Excel Worksheet in C# / VB

Hi Horst,

Wild guessing he maybe iit s some sort of reserved word (i think it is
afraid of cell naming...).
Try with other names - they should work

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com

"Horst Walter" wrote in message
m...
I create an Excel worksheet in C# (should be similar in VB)

Connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

Create string:
"CREATE TABLE S1 (Dt date, St char(40), Cr currency)"

Works fine, but the worksheet is named _S1 (UNDERSCORE!) and not S1.
Why does this happen? Any ideas?

Thx HW



  #3   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 1
Default Create Excel Worksheet in C# / VB

Hi,

Try to wrap table name into square brackets

CREATE TABLE [S1] ...

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp

"Horst Walter" wrote in message
m...
I create an Excel worksheet in C# (should be similar in VB)

Connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

Create string:
"CREATE TABLE S1 (Dt date, St char(40), Cr currency)"

Works fine, but the worksheet is named _S1 (UNDERSCORE!) and not S1.
Why does this happen? Any ideas?

Thx HW



  #4   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 2
Default Create Excel Worksheet in C# / VB

Hi Val,

"Val Mazur" wrote in message
...
Hi,

Try to wrap table name into square brackets

CREATE TABLE [S1] ...


It doesn't work (already tried that :) ). Also parenthesis have no effect...

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rthand.com


  #5   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 2
Default Create Excel Worksheet in C# / VB

Thanks for your answers.
As a matter of fact, the name S1 seems to be the problem.

Summary:
========
This works:
CREATE TABLE mytable (Dt date, St char(40), Cr currency)

CREATE TABLE S1 (Dt date, St char(40), Cr currency)
= Worksheet's name will be _S1

CREATE TABLE [S1] (Dt date, St char(40), Cr currency)
does not work



Google index
C# Excel worksheet underscore

(Horst Walter) wrote in message om...
I create an Excel worksheet in C# (should be similar in VB)

Connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

Create string:
"CREATE TABLE S1 (Dt date, St char(40), Cr currency)"

Works fine, but the worksheet is named _S1 (UNDERSCORE!) and not S1.
Why does this happen? Any ideas?

Thx HW



  #6   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 2
Default Create Excel Worksheet in C# / VB

Horst,

Don't mean to jump on on your thread here but I have a question for you. Do
you know where I can find documentation for Excel when creating tables using
ADO.Net? i.e. - datatypes and general syntax ...

Thanks,
Rob Panosh

"Horst Walter" wrote in message
m...
I create an Excel worksheet in C# (should be similar in VB)

Connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

Create string:
"CREATE TABLE S1 (Dt date, St char(40), Cr currency)"

Works fine, but the worksheet is named _S1 (UNDERSCORE!) and not S1.
Why does this happen? Any ideas?

Thx HW



  #7   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 7
Default Create Excel Worksheet in C# / VB

On Mon, 5 Jan 2004 07:10:17 -0600, "Rob Panosh"
wrote:

¤ Horst,
¤
¤ Don't mean to jump on on your thread here but I have a question for you. Do
¤ you know where I can find documentation for Excel when creating tables using
¤ ADO.Net? i.e. - datatypes and general syntax ...
¤

You should be able to use the Jet database provider DDL syntax:

HOWTO: Common DDL SQL for the Microsoft Access Database Engine
http://support.microsoft.com/default...;EN-US;Q180841


Paul ~~~
Microsoft MVP (Visual Basic)
  #8   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 5
Default Create Excel Worksheet in C# / VB

Try this:

http://www.kjmsolutions.com/datasetarray.htm

This will write the dataset to an array and then to an excel spreadsheet.

Also, solutions like these can be found by using the VB.NET/ADO.NET free
search engine tool at
http://www.kjmsolutions.com/newsgrouptool.htm


"Rob Panosh" wrote in
message ...
Horst,

Don't mean to jump on on your thread here but I have a question for you.

Do
you know where I can find documentation for Excel when creating tables

using
ADO.Net? i.e. - datatypes and general syntax ...

Thanks,
Rob Panosh

"Horst Walter" wrote in message
m...
I create an Excel worksheet in C# (should be similar in VB)

Connection String:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

Create string:
"CREATE TABLE S1 (Dt date, St char(40), Cr currency)"

Works fine, but the worksheet is named _S1 (UNDERSCORE!) and not S1.
Why does this happen? Any ideas?

Thx HW





  #9   Report Post  
Posted to microsoft.public.dotnet.languages.csharp,microsoft.public.excel.programming,microsoft.public.dotnet.framework.adonet
external usenet poster
 
Posts: 2
Default Create Excel Worksheet in C# / VB

Thanks...

Rob

"Paul Clement" wrote in message
...
On Mon, 5 Jan 2004 07:10:17 -0600, "Rob Panosh"


wrote:

¤ Horst,
¤
¤ Don't mean to jump on on your thread here but I have a question for you.

Do
¤ you know where I can find documentation for Excel when creating tables

using
¤ ADO.Net? i.e. - datatypes and general syntax ...
¤

You should be able to use the Jet database provider DDL syntax:

HOWTO: Common DDL SQL for the Microsoft Access Database Engine
http://support.microsoft.com/default...;EN-US;Q180841


Paul ~~~
Microsoft MVP (Visual Basic)



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I create GST worksheet in excel jl New Users to Excel 7 July 2nd 09 07:20 PM
How do I create a worksheet within a worksheet in Excel? Julieee Excel Worksheet Functions 1 December 23rd 05 01:33 AM
How do I create a Map with an Excel worksheet? bamat Excel Worksheet Functions 3 September 23rd 05 09:10 PM
how do i create a path to a worksheet from outside of excel wuuf Excel Discussion (Misc queries) 0 July 18th 05 11:00 PM
Create Excel worksheet in .Net Brian Johnson Excel Programming 0 September 25th 03 08:18 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"