Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

importing excel file data to a datawindow

1,797 views
Skip to first unread message

Gerald

unread,
Dec 19, 2001, 3:49:54 PM12/19/01
to
I'm trying to import data from an excel file that contains 20 columns and
about 25 rows. However, some of the columns contain alphabetic data that
contains several lines of text. Therefore, when I save the file as a tab
delimited text file it causes problems when importing to the datawindow.
The datawindow thinks that the column data, which gets word-wrapped, is
several different records when in fact it is only one. By the way I am
using PB 5.

Gerald

Bruce Armstrong [TeamSybase]

unread,
Dec 20, 2001, 7:19:38 PM12/20/01
to
Whenever I need to pull data from an Excel file I just use OLE to fire up
Excel, copy the data to the clipboard, and then copy that into the datawindow.
Try something like this:

string ls_pathname, ls_filename
long ll_rc
oleobject loo_excel

IF GetFileOpenName ( "Open File", ls_pathname, ls_filename, "XLS", "Excel Files
(*.xls),*.xls" ) < 1 THEN Return

loo_excel = CREATE OLEObject
loo_excel.ConnectToNewObject( "excel.application" )
loo_excel.visible = false
loo_excel.workbooks.open( ls_pathname )
loo_excel.ActiveCell.CurrentRegion.Select()
loo_excel.Selection.Copy()
ll_rc = dw_1.ImportClipBoard ( 2 )
ClipBoard('')
loo_excel.workbooks.close()
loo_excel.disconnectobject()
DESTROY loo_excel

On Wed, 19 Dec 2001 15:49:54 -0500,
in powersoft.public.powerbuilder.general

Bruce Armstrong [TeamSybase]
http://www.needhim.org

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Terry Dykstra

unread,
Dec 24, 2001, 11:35:01 AM12/24/01
to
To read Excel, I often use ODBC. Define a named range with the first row
containing the column headers (use UPPERCASE). Then define an Excel DSN
using MS or PB/Intersolv driver.

--
Terry Dykstra (TeamSybase)
Please state PB / OS / DB versions in your post.
MySybase http://my.sybase.com/mysybase
Search Deja: http://www.pfcguide.com/_newsgroups/search.asp

"Bruce Armstrong [TeamSybase]" <NOCANSPAM_br...@teamsybase.com>
wrote in message news:AycctUb...@forums.sybase.com...

0 new messages