Jump to content

nevodj

Active Members
  • Posts

    65
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

nevodj's Achievements

Wayfarer

Wayfarer (2/7)

0

Reputation

  1. Thanks M23. I will look into this.
  2. Hello, I am using the _Sql_GetTableAsString function to get the data as a string, then stringreplace to replace the carriage returns in the string with pipes, then using guictrlsetdata to push that into the combobox. I am not sure how I'd load multiple fields. Any help is appreciated.
  3. I knew someone would ask that.... ID is a database primary key so means nothing to the user. To deal with duplicates in the list, I may display name and city or something like that.
  4. Hello, In my GUI I have a combobox that is populated from an SQL query, like select id, name from persons. In the combobox I want to display the name, but when the person's name is selected from the combobox, I want to retrieve the id relevant to the selected person, so I can use it later in the script. GUICtrlRead will return the person name, but that will not work as it may not be unique. How can I read the ID of the selected person? It's hard to explain, apologies if this is not clear.
  5. Hello, How can I detect when a user tabs out of a box in my GUI? I have an inputbox where the user enters a number, and when they tab out of the box it needs to call a function. This is because the value will be entered by a barcode scanner which sends a tab key. The scanner can also send an enter key, so it may be better to send an enter key after the value is entered, and trigger the function. So I need a way to trigger the function if an enter key is pressed, only while that inputbox is selected. Thanks
  6. Hello, When using _IECreateEmbedded, like in the example in the AutoIT help, it waits till the page is completely loaded before you can do anything else in your GUI. Therefore if the page doesnt load for some reason i.e a problem with the website or internet connection etc, the GUI will not repspond to any user request so the only way to close GUI is task manager. Is there a workaround for this? Nevodj
  7. Oh the other thing - i had BackgroundQuery:=False after my refresh statement in VBA - how would i include that? It doesnt seem like you can have any spaces in the command. E.G i tried $oQuery.Refresh BackgroundQuery:=False
  8. Thank you @Water - I have it working now using your example. I had some errors in my code.
  9. It doesnt work, because you can't use ActiveSheet without the 'With' / 'End With' clause. or i can't seem to anyway. E.G if i do: (within excel) ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range("A4"), Sql:=sqlstring) ActiveSheet.Refresh BackgroundQuery:=False It tells me compile error expecting '='
  10. Or if you could help me to this it would be even better Sub Query() Dim qt As QueryTable sqlstring = "select * from stockitems" connstring = "ODBC;Driver={SQL Server};Server=sqlserver;Database=testdb;Uid=sa; Pwd=sa;" With ActiveSheet.QueryTables.Add(Connection:=connstring, Destination:=Range("A1"), Sql:=sqlstring) .Refresh End With End Sub
  11. @Water How do you translate a VBA macro into autoIT? My macro above for example.
  12. you need to add /t to the cacls command to include subdirectories and files. You can still access the files through recent or filepaths. You could also edit the registry to remove access to the folder options tab in windows explorer, and the Security tab from the properties dialogue when you lock the folder, then show them again when you unlock.
  13. Because i couldnt work out how to convert the VBA to AutoIT... What I was trying to do there is no functions for in the UDF. I found a workaround... instead of creating the workbook by _ExcelWorkbookNew, I used fileinstall to place a copy of a blank workbook with my macro in it in the temporary directory, then open it using _ExcelBookOpen(@TempDir & "ExcelMacro.xlsm",0) and populate the sheet from AutoIT as desired. Then I run the macro using $oExcel.Run("MacroName") The macro performs the desired actions and self deletes, I save the workbook as and delete the temporary .xlsm file with FileDelete. It works - thought I'd post incase it helped someone else...
  14. You can only do this if the maco is stored in the sheet. I am creating a new sheet from AutoIT
  15. Hello, i have been scouring the forums for a solution on this but cannot find anything that answers my question, althought there is hundreds of threads on the excel UDF I am creating an excel sheet within autoit (hidden) and then i want to run the following macro on the sheet: Sub insertlines() Dim i As Long: i = 1 Do Until Cells(i, 1) = "" If Cells(i, 2).Value <> Cells(i + 1, 2).Value Then Range(Cells(i, 1), Cells(i, 16)).Borders(xlEdgeBottom).LineStyle = xlContinuous End If i = i + 1 Loop With ActiveWindow .SplitColumn = 0 .SplitRow = 1 End With ActiveWindow.FreezePanes = True End Sub Can anyone advise how to do this? thanks
×
×
  • Create New...