randallc Posted November 14, 2005 Share Posted November 14, 2005 Hi,I will transfer documentation to try to keep the UDf 1st post shorter;please reply onnly to the other thread [link in signature]Best, RandallHere is the more formal attempt at a UDF with examples of usage.=============================================================================== Description: Various functions to communicate with Excel files via com Turns off calculation to manual, and returns to auto/ manual which was preset if "Save" requested Can display [/ or not] as it goes, save at end or not, and exit with /or without] save Simple; Read, Add, Write ("Into") Complex; Write on a row (option column) a tab-delimited string (eg from text file) Complex; Append after last row as optionShort Syntax _XLread($sFilePath,$Sheet,$Column,$Row) _XLwrite($sFilePath,$Sheet,$Column,$Row,$ExcelValue) _XLwriteCol($sFilePath,$Sheet,$Column,$Row,$ExcelValue) _XLpaste($sFilePath,$Sheet,$Column$Row,$ExcelValue,$Save) _XLcsvPaste($sFilePath,$Sheet,$Column,$Row,$Save$csvPath,$ToColumn) _XLadd($sFilePath,$Sheet,$Column,$Row,$ExcelValue) _XLmacroRun($sFilePath,$Sheet,$ExcelValue) _XLcalc($sFilePath) _XLclose($sFilePath,$Save) _XLexit($sFilePath) [saves changes and exit Excel] -or _XLexit($sFilePath, "Save") _XLexit($sFilePath,$Save) [/ _XLexit($FilePath,"NOSave"); NO changes and exit Excel] _XLlastRow($sFilePath,$Sheet) _XLsave($sFilePath,$Sheet) _XLshow($sFilePath,$Sheet) _XLready($sFilePath) _XLsort($FilePath,$Column1,$xlAscending,$Column2,$xlAscending,$SortRange) _XLSaveAs($FilePath,$NewPath) _XLSaveAs($FilePath,$SortedFileText,"csv") $WorkbookPropArray=_XLSheetProps($FilePath) _XLReadOnly($FilePath) $XLCopyRange=_XLCopy($cFilePath,$Sheet,$NamedRange) -PAIRED WITH _XLCopyTo($FilePath,$Sheet,$Column,$Row,$XLCopyRange) _XLFormat($FilePath,1,"A:A",1,$DateWorld) _XLArrayWrite($XLArray,$FilePath,1,"A1",1) _XLArrayRead($cFilePath,1,"") _XLCreateBlank($FilePath) Long : _ExcelCOM($sFilePath,$Sheet,$Column,$Row,$MEExcelCom,$Save,$ExcelValue,$Visible,$Exit,$LastRow,$ToColumn)=============================================================================== _XLChart _XLArrayRead, _ XLArrayWrite _AddGeneral _XLSaveAs with "csv" // XLFormat // XLCreateBlank // 1_8_2 _XLArrayRead, _ XLArrayWrite _AddGeneral 1.7.8_XLCopy, _XLCopyTo 1.7.5 Sept23rd _XLReadOnly 1.6.9 Sept21stfunction -better, ?got it with compounds_XLSaveAs to open template and save new name; then open that one if you want..._XLSort EDIT Sept19th 1_4_7 - Added sort command; usage;_XLSheetPropsSept21st **EDIT-SaveAs, ReadOnly; OK now? changed1.6.7//Sept21st 1_6_4 array already in "return"EDIT; Attachment UDF (end of post) goes in your "include" directory; then run examples with "#include")(SQLite needs dll registered - caution above - thanks ptrex) ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now