Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Exporting to Excel and Apostrophies

Hi All,
I am using the following function to output data to an excel (.xls) file via
a dataset, listview, etc...

Dim m_sConn1 As String = ""
m_sConn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FileName$ & ";Extended Properties=""Excel
8.0;HDR=YES"""
Dim conn As New OleDbConnection

I am INSERTing the data into the file.
All works wonderfully; but every cell has an Apostrophe in the beginning of
the cells value. I understand that this is representing a TEXT data type;
but it messes things up when trying to sort by dates or numbers.

Does anyone have any idea as to the resolution for this?

Thanks,
John.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Exporting to Excel and Apostrophies

John:

Are you using a Strongly Typed Dataset? If not, are you specifying the
column data types in your untyped dataset?

--

W.G. Ryan, eMVP

Have an opinion on the effectiveness of Microsoft Embedded newsgroups?
Let Microsoft know!
https://www.windowsembeddedeval.com/...ity/newsgroups
"John" wrote in message
...
Hi All,
I am using the following function to output data to an excel (.xls) file

via
a dataset, listview, etc...

Dim m_sConn1 As String = ""
m_sConn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & FileName$ & ";Extended Properties=""Excel
8.0;HDR=YES"""
Dim conn As New OleDbConnection

I am INSERTing the data into the file.
All works wonderfully; but every cell has an Apostrophe in the beginning

of
the cells value. I understand that this is representing a TEXT data type;
but it messes things up when trying to sort by dates or numbers.

Does anyone have any idea as to the resolution for this?

Thanks,
John.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Exporting to Excel and Apostrophies

"William Ryan eMVP" wrote ...

John:

Are you using a Strongly Typed Dataset? If not, are you specifying the
column data types in your untyped dataset?

--

W.G. Ryan, eMVP


Is the OP even a dataset?! I understood he was excuting INERT INTO
statements against the Jet Provider.

Jamie.

--
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Exporting to Excel and Apostrophies



The Data Type for each column is "Text"

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Exporting to Excel and Apostrophies

The Source of the Data being exported to the file is in a variety of
forms.

DataSet
ListView
DataGrid
Etc...

The point is, regardless, I create the column structure and then the
Insert Into statement for each row. Everything works great with the
exception of the apostrophy bing created in the begining of each cell of
the file.

The only way to remove this apostropy is via another procedure/program
that loops through and removes this special character(by excel
standards).



*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
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
exporting to excel camri6 Excel Discussion (Misc queries) 3 December 4th 08 08:30 AM
exporting to excel boba Excel Discussion (Misc queries) 0 July 23rd 07 03:46 AM
Exporting into Excel Chey Excel Discussion (Misc queries) 2 October 3rd 06 03:39 PM
Exporting from Excel Secret Squirrel Excel Discussion (Misc queries) 1 February 8th 06 03:37 PM
Exporting from Excel Tom J. Excel Discussion (Misc queries) 1 July 8th 05 02:20 PM


All times are GMT +1. The time now is 12:48 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"