Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Access to Excel Automation ADODB Problem

Am stuck on a problem with Automation string character
limitations.

I am using ADODB recordsets and Late Binding Object
Automation to export data from Access to Excel. One of the
fields in this recordset is a memo field which will often
have more than 255 characters. Due to the Automation
Object limitations - only the first 255 character will be
inserted into Excel.
To overcome this problem I am splitting the memo fields
into 255 character chunks which are inserted into seperate
cells with the view of recombining them using the
CONCATENATE function.
After entering the formula in the cell and opening the
resulting file - I find that the formula still only
displays the first 255 characters. If you then select the
cell, click in the formula bar and confirm by pressing
enter - the entire string is then successfully displayed.

To try to overcome this I have tried every possible
combination of range and application recalculates. I have
tried using a find and replace on the "=" in the formula.
I have even tried making the Excel Application visible
during the running of the sub and emulating the cell
selection and confirmation by using SendKeys "{F2}" then
SendKeys "{ENTER}" - but this still does not work.

Any advice that the experienced coders can offer would be
GREATLY appreciated.
I am more than happy to provide more information if required.

Regards,
Matt Slattery
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Access to Excel Automation ADODB Problem


You may have already tried this, but did you try
combining them in VBA, rather than using an Excel
Formula, with something like:

Activecell.Value = Activecell.Offset(0,-2).Value &
Activecell.Offset(0,-1).Value






-----Original Message-----
Am stuck on a problem with Automation string character
limitations.

I am using ADODB recordsets and Late Binding Object
Automation to export data from Access to Excel. One of

the
fields in this recordset is a memo field which will often
have more than 255 characters. Due to the Automation
Object limitations - only the first 255 character will be
inserted into Excel.
To overcome this problem I am splitting the memo fields
into 255 character chunks which are inserted into

seperate
cells with the view of recombining them using the
CONCATENATE function.
After entering the formula in the cell and opening the
resulting file - I find that the formula still only
displays the first 255 characters. If you then select

the
cell, click in the formula bar and confirm by pressing
enter - the entire string is then successfully displayed.

To try to overcome this I have tried every possible
combination of range and application recalculates. I

have
tried using a find and replace on the "=" in the

formula.
I have even tried making the Excel Application visible
during the running of the sub and emulating the cell
selection and confirmation by using SendKeys "{F2}" then
SendKeys "{ENTER}" - but this still does not work.

Any advice that the experienced coders can offer would be
GREATLY appreciated.
I am more than happy to provide more information if

required.

Regards,
Matt Slattery
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Access to Excel Automation ADODB Problem

"Matt Slattery" wrote ...

I am using ADODB recordsets and Late Binding Object
Automation to export data from Access to Excel. One of the
fields in this recordset is a memo field which will often
have more than 255 characters. Due to the Automation
Object limitations - only the first 255 character will be
inserted into Excel.


Why are you using automation at all? You don't even need a recordset
(but may want to use one if you are operating on an open workbook).

e.g. to create a new Excel table (and worksheet/workbook if
necessary):

SELECT
MyMemoCol
INTO
[Excel 8.0;HDR=YES;Database=C:\MyJetDB.mdb.].NewExcelTable
FROM
[Database=C:\MyJetDB.mdb.].MyTable
;

e.g. to append to an existing Excel table:

INSERT INTO
[Excel 8.0;HDR=YES;Database=C:\MyJetDB.mdb.].[MyExcelTable]
(MyExcelCol)
SELECT
MyMemoCol AS MyExcelCol
FROM
[Database=C:\MyJetDB.mdb.].MyTable
;

If using an existing table, you need to ensure the relevant column is
'seen' by Jet as ype 'Memo'. For details, see:

http://www.dicks-blog.com/excel/2004...al_data_m.html

If you are using a connection to either the .mdb or the .xls, you can
omit the connection string from the sql text.

Jamie.

--
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
access database (adodb)from excel vba AskExcel Excel Worksheet Functions 0 July 17th 06 02:01 AM
XL & Access 2000, ADODB and the Find Method Mike Mertes Excel Programming 0 July 29th 04 03:27 PM
Automation Code Problem from Access to Excel Tony Excel Programming 2 April 26th 04 12:58 AM
ADODB Connection to Access Cindy Excel Programming 1 February 27th 04 11:51 AM
Export from Excel to Access ADODB javydreamercsw Excel Programming 2 February 19th 04 09:49 PM


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