<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>Importing Data from Excel (XLS) file to HF</title>
        <description> All,

An example of importing data from an Excel file to a HF file - this example imports the ISO Countries data (Countries data sourced from the ISO standards web site).

This was originally posted on the main WD forum, but thought it may be useful here as well:


IDXLSFile is int
iNo_rows is int
glocaliIResult is int

// Open the Currencies excel file
IDXLSFile = xlsOpen(&amp;quot;c:\My Projects\InterPoint\Extract Files for Import\currencies.xls&amp;quot;)

// If the Excel file was found, then carry on processing
// ELSE
// Report an error
IF IDXLSFile &amp;lt;&amp;gt; -1 THEN
	
	// Get number of rows in the Excel file
	iNo_rows = xlsNbRow(IDXLSFile)
	
	// Test for existence of Country table
	IF NOT HOpen(Country,hOReadWrite) THEN
		Error(&amp;quot;Unable to locate the required Country database table!&amp;quot;)
		RETURN
	END
		
	// HCreation will delete and re-create these tables and also reset all the rec no&amp;#039;s and auto IDs
	HCreation(Country)
		
	// Process each row of the Excel file
	// Start at row 2 to ignore the Excel title row...
	FOR glocaliNV_Row = 2 TO iNo_rows
		
		// Country Details
		Country.cCountryCode = xlsData(IDXLSFile,glocaliNV_Row,1)
		Country.cCountryName = xlsData(IDXLSFile,glocaliNV_Row,5)
		Country.cCurrencyCode = xlsData(IDXLSFile,glocaliNV_Row,2)
		Country.nCurrencyCode = xlsData(IDXLSFile,glocaliNV_Row,3)
		Country.cCurrencyDesc = xlsData(IDXLSFile,glocaliNV_Row,4)
		Country.bActiveCountry = xlsData(IDXLSFile,glocaliNV_Row,6)
		Country.bActiveCurrency = xlsData(IDXLSFile,glocaliNV_Row,7)
		Country.cCurrencySymbol = &amp;quot;&amp;quot;
		Country.dtCreated = DateSys + TimeSys
		Country.cNotes = &amp;quot;Auto loaded from ISO import file on &amp;quot; + DateToString(DateSys())
		
		// Write the data to the database
		HAdd(Country)
						
	END
	
	// Close XLS file
	xlsClose(IDXLSFile)
		
ELSE
	Info(xlsMsgError(IDXLSFile))	

END
</description>
        <link>https://www.wxforum.info/read.php?27161,22800,22800#msg-22800</link>
        <lastBuildDate>Tue, 14 Apr 2026 13:44:10 +0200</lastBuildDate>
        <generator>Phorum 5.2.23</generator>
        <item>
            <guid>https://www.wxforum.info/read.php?27161,22800,174384#msg-174384</guid>
            <title>Re: Importing Data from Excel (XLS) file to HF</title>
            <link>https://www.wxforum.info/read.php?27161,22800,174384#msg-174384</link>
            <description><![CDATA[ gracias por tu aporte me dio mucha ayuda]]></description>
            <dc:creator>edmundo</dc:creator>
            <category>WinDev Solutions</category>
            <pubDate>Wed, 02 Oct 2013 21:51:12 +0200</pubDate>
        </item>
        <item>
            <guid>https://www.wxforum.info/read.php?27161,22800,92495#msg-92495</guid>
            <title>Re: Importing Data from Excel (XLS) file to HF</title>
            <link>https://www.wxforum.info/read.php?27161,22800,92495#msg-92495</link>
            <description><![CDATA[ Hi <br />
<br />
Does excel need to be installed on the users computer to use this method<br />
<br />
Thanks for the code!!<br />
<br />
Allard]]></description>
            <dc:creator>Allard</dc:creator>
            <category>WinDev Solutions</category>
            <pubDate>Wed, 09 Feb 2011 16:14:48 +0100</pubDate>
        </item>
        <item>
            <guid>https://www.wxforum.info/read.php?27161,22800,41490#msg-41490</guid>
            <title>Re: Importing Data from Excel (XLS) file to HF</title>
            <link>https://www.wxforum.info/read.php?27161,22800,41490#msg-41490</link>
            <description><![CDATA[ Thanx a lot]]></description>
            <dc:creator>Grand77</dc:creator>
            <category>WinDev Solutions</category>
            <pubDate>Wed, 25 Nov 2009 00:37:00 +0100</pubDate>
        </item>
        <item>
            <guid>https://www.wxforum.info/read.php?27161,22800,22800#msg-22800</guid>
            <title>Importing Data from Excel (XLS) file to HF</title>
            <link>https://www.wxforum.info/read.php?27161,22800,22800#msg-22800</link>
            <description><![CDATA[ All,<br />
<br />
An example of importing data from an Excel file to a HF file - this example imports the ISO Countries data (Countries data sourced from the ISO standards web site).<br />
<br />
This was originally posted on the main WD forum, but thought it may be useful here as well:<br />
<br />
<pre class="bbcode">
IDXLSFile is int
iNo_rows is int
glocaliIResult is int

// Open the Currencies excel file
IDXLSFile = xlsOpen(&quot;c:\My Projects\InterPoint\Extract Files for Import\currencies.xls&quot;)

// If the Excel file was found, then carry on processing
// ELSE
// Report an error
IF IDXLSFile &lt;&gt; -1 THEN
	
	// Get number of rows in the Excel file
	iNo_rows = xlsNbRow(IDXLSFile)
	
	// Test for existence of Country table
	IF NOT HOpen(Country,hOReadWrite) THEN
		Error(&quot;Unable to locate the required Country database table!&quot;)
		RETURN
	END
		
	// HCreation will delete and re-create these tables and also reset all the rec no&#039;s and auto IDs
	HCreation(Country)
		
	// Process each row of the Excel file
	// Start at row 2 to ignore the Excel title row...
	FOR glocaliNV_Row = 2 TO iNo_rows
		
		// Country Details
		Country.cCountryCode = xlsData(IDXLSFile,glocaliNV_Row,1)
		Country.cCountryName = xlsData(IDXLSFile,glocaliNV_Row,5)
		Country.cCurrencyCode = xlsData(IDXLSFile,glocaliNV_Row,2)
		Country.nCurrencyCode = xlsData(IDXLSFile,glocaliNV_Row,3)
		Country.cCurrencyDesc = xlsData(IDXLSFile,glocaliNV_Row,4)
		Country.bActiveCountry = xlsData(IDXLSFile,glocaliNV_Row,6)
		Country.bActiveCurrency = xlsData(IDXLSFile,glocaliNV_Row,7)
		Country.cCurrencySymbol = &quot;&quot;
		Country.dtCreated = DateSys + TimeSys
		Country.cNotes = &quot;Auto loaded from ISO import file on &quot; + DateToString(DateSys())
		
		// Write the data to the database
		HAdd(Country)
						
	END
	
	// Close XLS file
	xlsClose(IDXLSFile)
		
ELSE
	Info(xlsMsgError(IDXLSFile))	

END</pre>
]]></description>
            <dc:creator>DarrenF</dc:creator>
            <category>WinDev Solutions</category>
            <pubDate>Thu, 26 Feb 2009 17:41:31 +0100</pubDate>
        </item>
    </channel>
</rss>
