Welcome! Log In Create A New Profile

Advanced

Problem when importing data from a xls file

Posted by Antonino.pcs.crosspost 
Antonino.pcs.crosspost
Problem when importing data from a xls file
July 29, 2008 09:59AM
Hello everyone! I am using the express version of WinDev 12 waiting for my brand new license to arrive. I need to write a routine that reads data from an xls file and writes some lines containing those data to a txt file. The point is that when I try to use the xlsCurrentSheet function to select, for example the second sheet, it doesn;t work because only the first sheet is selected. This doesn't happen with all the xls files. So I was wondering if there are limitations about the xls functions or if this is just a problem of the express version.

Thank you all!!!


Best Regards
Antonino

Message forwarded from pcsoft.us.windev
Marc De Swert
Re: Problem when importing data from a xls file
July 29, 2008 10:52AM
hi Antonio,
mayby this will help you out, i used it on WD8 and WD10


//lp_Dir = C:\BRONCODE\BEWEGING_WD10\Exe\Import
// the place for the excell file

lp_Naam = fSelect(lp_Dir, "", "Selecteer het in te lezen xls-bestand" ,...
"Excel bestanden"+TAB+"*.xls"+CR+"Alle bestanden (*.*)"+TAB+"*.*", "", fselOpen+fselExist)


//lp_naam = C:\BRONCODE\BEWEGING_WD10\Exe\Import\test2.xls

IF lp_Naam<>"" AND Lower(Right(lp_Naam, 4))=".xls" THEN
XLS>>Visible = OLETrue //olefalse
XLS>>Workbooks>>Open(lp_Naam)
XLS>>Sheets(3)>>select


//XLS>>Sheets(3) index or by giving the name Sheets("NameSheet")

END


grt Marc :xcool:
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: