Kiti Posted June 21, 2008 Share Posted June 21, 2008 I want to write something in Excel, and the column it's given by the current date. When I try: _ExcelWriteCell($oExcel, "Test", 1, @MDAY) Nothing happens. Any ideea why? Maybe @MDAY is not returned as a number? Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
monoceres Posted June 21, 2008 Share Posted June 21, 2008 (edited) If you learn to debug properly you can figure these things out yourself For example this simple line will probably solve the problem for you: MsgBox(0,"Debug",@MDAY&@CRLF&VarGetType(@MDAY)) Edited June 21, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Kiti Posted June 21, 2008 Author Share Posted June 21, 2008 (edited) If you learn to debug properly you can figure these things out yourself For example this simple line will probably solve the problem for you: MsgBox(0,"Debug",@MDAY&@CRLF&VarGetType(@MDAY)) Where can I learn to debug properly? The only sources I use for learning are SciTe Help, and other posts on the forum. No debuging in eitherone. Tnx for the help Now, how can I convert it to number? In the help, I saw only to binary and to hex... I got used to logical things in AutoIt. So... If it is a VarGetType, why not a VarSetType? Edited June 21, 2008 by Kiti Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
ChrisL Posted June 21, 2008 Share Posted June 21, 2008 (edited) This should work _ExcelWriteCell($oExcel, "Test", 1, Int(@MDAY)) or _ExcelWriteCell($oExcel, "Test", 1, Number(@MDAY)) Edited June 21, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Kiti Posted June 21, 2008 Author Share Posted June 21, 2008 This should work _ExcelWriteCell($oExcel, "Test", 1, Int(@MDAY)) or _ExcelWriteCell($oExcel, "Test", 1, Number(@MDAY)) Thank you!!!!! Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
monoceres Posted June 21, 2008 Share Posted June 21, 2008 (edited) Just use Int() on the macro before passing it to _ExcelWriteCell(): _ExcelWriteCell($oExcel, "Test", 1, Int(@MDAY)) Here's the functions I usually use when debugging: _ArrayDisplay(); So f-ing useful! ConsoleWrite(); Display debug data during the execution of the script MsgBox(); Halt and displays data VarGetType(); Very important, as you could see before StringLen(); Usefull to see if there are any hidden characters in a string that f's up the script (leading and trailing spaces etc.) UBound(); To see how big your arrays are @ScriptLineNumber; Macro so you can see which line the script is at ; And of course the debug UDF included in the standard installation, I never use it though, seems like overkill. Edit: Too late, but at least you got some debug info Edited June 21, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Kiti Posted June 21, 2008 Author Share Posted June 21, 2008 Thank you a lot, moncores! Do you know how can I prevent a windows from beeing closed? I have an OnExitFunc, and I want to prevent the windows that function is working in to be closed before the script is. I didn't post another topic because I thought it's a minor question, and maybe you can answer it Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 Link to comment Share on other sites More sharing options...
monoceres Posted June 21, 2008 Share Posted June 21, 2008 Thank you a lot, moncores! Do you know how can I prevent a windows from beeing closed? I have an OnExitFunc, and I want to prevent the windows that function is working in to be closed before the script is. I didn't post another topic because I thought it's a minor question, and maybe you can answer it Huh?Use #NoTrayIcon if you don't want the user to exit your script through the tray icon. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Kiti Posted June 21, 2008 Author Share Posted June 21, 2008 Huh?Use #NoTrayIcon if you don't want the user to exit your script through the tray icon.Sorry, I didn't expressed myself clearly. This is what my script (I want to) do: Someone works in excel, and at the end of each day, some final data is moved around in that's day coresponding column. But if the user exits Excel first, the script can't do that task, because the file to which it is attached is closed. Also, this has to be the last thing done, so it has to be onExit. What I want to do is to restrict the order these two can be closed (Excel and my script). And, if my script don't let Excel to be closed, then the user will close first my script, and second, Excel, so the conditon of the closing order is met. But I don't know how to make Excel "uncloseable". I hope you understood. Think outside the box.My Cool Lego Technic Website -- see walking bipeds and much more!My YouTube account -- see cool physics experimentsMy scripts:Minesweeper bot: Solves advanced level in 1 second (no registry edit), very improved GUI, 4 solving stylesCan't go to the toilet because of your kids closing your unsaved important work? - Make a specific window uncloseableCock Shooter Bot -- 30 headshots out of 30 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