Jump to content

CC_Mu

Active Members
  • Posts

    22
  • Joined

  • Last visited

CC_Mu's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Got it, I may just rename the file one more time, dont want to mess up with the original function. Thank you for your help! TheXman Hey Water, thanks for reading this post, it is ok for me to rename the file one more time. Since I dont see much people have similar question like me, I am not sure if it worths for your to modify the UDF, but it is totally up to you! Thank you for developing this UDF, it is awesome!
  2. I am trying to save email's attachment to destination folder but the file name automatically replace space with an underscore, How can I eliminate this feature? this is my code _OL_ItemAttachmentSave($oOutlook, $aMail[1][0], Default, 1, "W:\myfolder\file name has space 2018.xlsx) however, the file saved is actually this How can I make sure the file name is saved as what I need? Thank you so much for helping me!
  3. Hey FrancescoDiMuro, thanks for replying me, because it is a pop-up window, I can not find its backend script, so I dont know how to use _IE* functions to interact with the pop up windows.
  4. I need to access to this website https://downloads.autocount.com/, type in ID and password, hit Sign in. Currently I use the following code to click the pop up window for ID and password, but nothing happened. Any idea what did i do wrong? #include <IE.au3> Local $user = "myid" Local $pw = "mypassword" Local $oIE = _IECreate ("https://downloads.autocount.com/") _IELoadWait($oIE) Sleep(2000) ControlSend("Windows Security", "", "[CLASS:Edit; INSTANCE:1]", $pw) the x86 info is here >>>> Window <<<< Title: Windows Security Class: #32770 Position: 929, 277 Size: 547, 366 Style: 0x96C80A84 ExStyle: 0x00010101 Handle: 0x000B11EC >>>> Control <<<< Class: Edit Instance: 1 ClassnameNN: Edit1 Name: Advanced (Class): [CLASS:Edit; INSTANCE:1] ID: Text: Position: 130, 108 Size: 238, 22 ControlClick Coords: 183, 19 Style: 0x500000A0 ExStyle: 0x00000000 Handle: 0x00081130 >>>> Mouse <<<< Position: 1251, 440 Cursor ID: 0 Color: 0x000000 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< OK Cancel >>>> Hidden Text <<<< Remember my credentials Thank you so much for helping me.
  5. Your codes works too! Thank you so much Juvigy!
  6. This code works! thank you so much Junkew!
  7. Hey Water, thank you so much. I tried this code, and add the error script just before Next If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeReplace", "Error replacing data the range." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeReplace", "Data successfully replaced in cells.") the error msg is 3: $sSearch is empty. I am not sure what should I do about this. Thank you so much for helping me
  8. it actually has no error, its says successfully replace. but actually nothing is replaced for those blank cells. and this is my error code If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeReplace", "Error replacing data the range." & @CRLF & "@error = " & @error & ", @extended = " & @extended) MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeReplace", "Data successfully replaced in cells.")
  9. Hey All, I have an excel worksheet, about A1:BD1500, and trying to replace all blank cells to zero, but following code doesn't work. What did i do wrong? Local $oRange = $oWorkbook.ActiveSheet.UsedRange.SpecialCells($xlCellTypeBlanks) _Excel_RangeReplace($oWorkbook, $oWorkbook.ActiveSheet, $oRange, "", "0") ConsoleWrite($oRange & @CRLF) the console writes nothing about $oRange, which I believe the first line code doesn't find the cells. Any ideas? Thank you for your help!
  10. I have a column header, like company, name, id, date etc
  11. Hey guys, I have an excel worksheet with 50 columns, 2000 rows, how I can re-arrange them by column name? e.g. current column a,b,c --> desired column a,c,b how I can do it? Thank you so much!!
  12. ok, I found out later by myself, the code should be Local $Formula2 ="="&$GP2&"/"&$Unit2
  13. what I want to do is to add a new column by sum Column A and Column B, and then add another new column to divide Column A by Column B if Column B is not zero, and then copy the formula to the last row by changing the row number (e.g. row 1 is A1+B1, then row 2 will be A2+B2). I am able to do sum, but can not divide, any insight here? thank you! the error msg say $GP2 and $Unit2 is successfully designated to the right variable (AE2 and AI2), but the following divide can not make the formula to be AE2/AI2, how can I do the divide? Local $Formula2 =$GP2/$Unit2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Full code is here ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Sum part is good to go ; Add 9 new column to sum by product Local $Name[9] = ["name1", "name2", "name3", "name4", "name5", "name6", "name7" ,"name8", "name9"] Local $Col[9] = ["AE", "AF", "AG", "AH", "AI", "AJ", "AK", "AL", "AM"] Local $Formula[9] = ["=B2+C2+D2", "=E2+F2+G2", "=H2+I2+J2", "=K2+L2+M2", "=N2+O2+P2", "=Q2+R2+S2", "=T2+U2+V2", "=Y2+Z2+AA2", "=AB2+AC2+AD2"] For $i = 0 To UBound($Name)-1 ConsoleWrite("Testing " & $Name[$i] & $Col[$i] & $Formula[$i] & @CRLF) _Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $Name[$i], $Col[$i]&"1") ;Add New Column Name _Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $Formula[$i], $Col[$i]&"2", False) ;Add Column Formula _Excel_RangeCopyPaste($oWorkbook.ActiveSheet, $Col[$i]&"2", $Col[$i]&"3:"&$Col[$i]&$LastRow, Default, $xlPasteFormats) ;Copy Formula to the rest of Column Next ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Divide part failed ; Add column to get Gross Profit per Unit Local $Name[2] = ["name10", "name11"] Local $Col[2] = ["AN", "AO"] Local $GP[2] = ["AE", "AF"] ;["name1", "name2"] Local $Unit[2] = ["AI", "AJ"];["name5", "name6"] ;Local $Formula = ["=AE2/AI2", "=AF2/AJ2"] For $i = 0 To UBound($Name)-1 Local $GP2 = $GP[$i]&"2" Local $Unit2 = $Unit[$i]&"2" Local $Formula2 =$GP2/$Unit2 MsgBox(1,"", $GP2) MsgBox(1,"", $Unit2) MsgBox(1,"", $Formula2) _Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $Name[$i], $Col[$i]&"1") ;Add New Column Name ;If $Unit[$i] = 0 Then ;Add New Column Formula ; _Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, "0", $Col[$i]&"2:"&$Col[$i]&$LastRow) ;Else _Excel_RangeWrite($oWorkbook, $oWorkbook.ActiveSheet, $Formula2, $Col[$i]&"2", False) _Excel_RangeCopyPaste($oWorkbook.ActiveSheet, $Col[$i]&"2", $Col[$i]&"3:"&$Col[$i]&$LastRow, Default, $xlPasteFormats) ;EndIf Next
  14. I believe it did not redirecting after opening it. Or how can i make sure about it? I did not see the weblink changed after opening it
  15. I read through the function, still can not understand how to use it, do you mind here?
×
×
  • Create New...