Put this file in your magento root folder.
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<?php
require_once 'app/Mage.php';
Mage::app()->setCurrentStore(0);
set_time_limit(0);
$products=Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('sku')
->addFieldToFilter('status',array(1));
$count =0;
$attr_array=array();
?>
<table border="2" id="myTable">
<tr>
<td>SKU</td>
</tr>
<?php
foreach($products as $pro){
?>
<tr><td><?php echo $pro['sku'] ?></td></tr>
<?php
}
?>
</table>
<a href="#" id="test" onClick="javascript:fnExcelReport();">download</a>
<script>
function fnExcelReport() {
var tab_text = '<html xmlns:x="urn:schemas-microsoft-com:office:excel">';
tab_text = tab_text + '<head><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>';
tab_text = tab_text + '<x:Name>Test Sheet</x:Name>';
tab_text = tab_text + '<x:WorksheetOptions><x:Panes></x:Panes></x:WorksheetOptions></x:ExcelWorksheet>';
tab_text = tab_text + '</x:ExcelWorksheets></x:ExcelWorkbook></xml></head><body>';
tab_text = tab_text + "<table border='1px'>";
tab_text = tab_text + $('#myTable').html();
tab_text = tab_text + '</table></body></html>';
var data_type = 'data:application/vnd.ms-excel';
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {
if (window.navigator.msSaveBlob) {
var blob = new Blob([tab_text], {
type: "application/csv;charset=utf-8;"
});
navigator.msSaveBlob(blob, 'all_skus.xls');
}
} else {
$('#test').attr('href', data_type + ', ' + encodeURIComponent(tab_text));
$('#test').attr('download', 'all_skus.xls');
}
}
</script>
And then run the file,for example
yourdomain.com/file_name.php
And click the download below the result,you will get result in csv file.