gcue Posted April 14, 2009 Share Posted April 14, 2009 hello. im using the excel udf that comes with the new version of autoit 3.3.0.0 is there a way to autoexpand or autosize the column width? i remember seeing the development of this udf and noting a _excelsetcolumnwidth function along the lines... Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 14, 2009 Share Posted April 14, 2009 In Excel, there's a method which can be applied to Range objects called AutoFit. I guess this is what you're after. In VBA: ActiveSheet.Columns(1).AutoFit [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
gcue Posted April 14, 2009 Author Share Posted April 14, 2009 so how can i use that syntax in autoit? Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 14, 2009 Share Posted April 14, 2009 #include <Excel.au3> Local $oExcel = _ExcelBookNew(1) _ExcelWriteCell($oExcel, "Something Long Here", 1, 1) _ExcelWriteCell($oExcel, "And something even longer", 2, 1) $oExcel.ActiveSheet.Columns(1).AutoFit Xandy 1 [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
gcue Posted April 14, 2009 Author Share Posted April 14, 2009 (edited) hmm not working... do i have to specify the activesheet name? _ExcelSheetActivate($oExcel, "PRINTERS") _ExcelWriteCell($oExcel, $asset_label, $p + 1, 1) _ExcelWriteCell($oExcel, $asset, $p + 1, 2) _ExcelWriteCell($oExcel, $printers[$p][0], $p + 1, 3) _ExcelWriteCell($oExcel, "YES", $p + 1, 4) _ExcelWriteCell($oExcel, $printernote, $p + 1, 5) $oExcel.ActiveSheet.Columns(1).AutoFit thanks for your help btw!!! Edited April 14, 2009 by gcue Link to comment Share on other sites More sharing options...
gcue Posted April 14, 2009 Author Share Posted April 14, 2009 ahh nevermind!! i got it... columns(##) hehe thanks again! Link to comment Share on other sites More sharing options...
WideBoyDixon Posted April 14, 2009 Share Posted April 14, 2009 You're using the first five columns. Try: $oExcel.ActiveSheet.Columns("A:E").AutoFit SkysLastChance and AnonymousX 1 1 [center]Wide by name, Wide by nature and Wide by girth[u]Scripts[/u]{Hot Folders} {Screen Calipers} {Screen Crosshairs} {Cross-Process Subclassing} {GDI+ Clock} {ASCII Art Signatures}{Another GDI+ Clock} {Desktop Goldfish} {Game of Life} {3D Pie Chart} {Stock Tracker}[u]UDFs[/u]{_FileReplaceText} {_ArrayCompare} {_ToBase}~ My Scripts On Google Code ~[/center] Link to comment Share on other sites More sharing options...
gcue Posted April 14, 2009 Author Share Posted April 14, 2009 even better... many many thanks! Link to comment Share on other sites More sharing options...
AnonymousX Posted April 18, 2018 Share Posted April 18, 2018 On 4/14/2009 at 7:48 AM, WideBoyDixon said: You're using the first five columns. Try: $oExcel.ActiveSheet.Columns("A:E").AutoFit Got to love when posts from almost a decade ago are still useful =) 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