Can you please tell us what is best way to import data from Microsoft Excel. 1. Using ODBC driver 2. Through DDE Communication with Excel 3. Save Excel sheet as tab delimited data and import into datawindow. Thanks in advance. RAJ
![]() |
0 |
![]() |
It depends. 1) Requires that you have a Named Range in Excel, with the first row used for Column headers. Works well, unless you have columns that have a mix of alpha and numeric values. Even if ODBC thinks the column is a char, it will skip the rows with a numeic value in that column. 2) OLE is more robust than DDE and gives you the ultimate flexibility. The spreadsheet data can be in any format. 3) Works great. Combine with OLE to automate the Excel part to save to tab-delimited. -- 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 "PUNNIARAJ T" <rajtp@hotmail.com> wrote in message news:EhGo4Y6wBHA.206@forums.sybase.com... > Can you please tell us what is best way to import data from Microsoft Excel. > 1. Using ODBC driver > 2. Through DDE Communication with Excel > 3. Save Excel sheet as tab delimited data and import into datawindow. > > Thanks in advance. > RAJ > > >
![]() |
0 |
![]() |
I agree with Terry that OLE is the way to go. Search www.google.com for "Powerbuilder excel ole" for numerous discussions on how to accomplish this. HTH -EGM PUNNIARAJ T <rajtp@hotmail.com> wrote in message news:EhGo4Y6wBHA.206@forums.sybase.com... > Can you please tell us what is best way to import data from Microsoft Excel. > 1. Using ODBC driver > 2. Through DDE Communication with Excel > 3. Save Excel sheet as tab delimited data and import into datawindow. > > Thanks in advance. > RAJ > > >
![]() |
0 |
![]() |
I would use Automation. For example: OleObject ExcelApp OleObject ExcelWorkSheet String MyVar ExcelApp = Create OleObject ExcelApp.ConnectToNewObject("Excel.Application") ExcelApp.Workbooks.Open("YourSpreadsheet.Xls") ExcelWorksheet = ExcelApp.ActiveSheet.Cells MyVar = ExcelWorkSheet.Cells(1,1).Value You could simply setup a loop and retrive values (could be number, dates, etc) as needed. You will need to spend some time looking at the Excel VBA Documentation. Good Luck Frank "PUNNIARAJ T" <rajtp@hotmail.com> wrote in message news:EhGo4Y6wBHA.206@forums.sybase.com... > Can you please tell us what is best way to import data from Microsoft Excel. > 1. Using ODBC driver > 2. Through DDE Communication with Excel > 3. Save Excel sheet as tab delimited data and import into datawindow. > > Thanks in advance. > RAJ > > >
![]() |
0 |
![]() |
Thanks Terry -Raj "Terry Dykstra" <dontreply_tddykstra@forestoil.ca> wrote in message news:G1sPDd6wBHA.304@forums.sybase.com... > It depends. > 1) Requires that you have a Named Range in Excel, with the first row used > for Column headers. Works well, unless you have columns that have a mix of > alpha and numeric values. Even if ODBC thinks the column is a char, it will > skip the rows with a numeic value in that column. > 2) OLE is more robust than DDE and gives you the ultimate flexibility. The > spreadsheet data can be in any format. > 3) Works great. Combine with OLE to automate the Excel part to save to > tab-delimited. > > -- > 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 > > "PUNNIARAJ T" <rajtp@hotmail.com> wrote in message > news:EhGo4Y6wBHA.206@forums.sybase.com... > > Can you please tell us what is best way to import data from Microsoft > Excel. > > 1. Using ODBC driver > > 2. Through DDE Communication with Excel > > 3. Save Excel sheet as tab delimited data and import into datawindow. > > > > Thanks in advance. > > RAJ > > > > > > > >
![]() |
0 |
![]() |