Search results for query: *

  1. F

    Question Thread & Listview

    I changed Private Sub AddListItems(ByVal list As ListBox, ByVal items As String()) for Private Sub AddListItems(ByVal list As ListBox, ByVal items As String) And now it say's that ListBox1.Items.AddRange(Directory.Getfiles(Inspfolder))) does not produce a value ListBox1.Invoke(New...
  2. F

    Question Thread & Listview

    It's the only way I understand them for now. Now, if I stick to what I just did. My invoke looks like this: ListBox1.Invoke(New Callback2(AddressOf AddListItems), ListBox1.Items.AddRange(Directory.GetFiles(Inspfolder))) But AddlistItems is underline with the following error: Error 1 Method...
  3. F

    Question Thread & Listview

    I have so many questions when I read all this... I guess I'll give it another try, but this is so over my skills. Here is what I've done as a 1st step: 'This is your exemple: Private Sub SetControlText(cntrl As Control, text As String) cntrl.Text = text End Sub 'I addaped to mine as...
  4. F

    Question Thread & Listview

    Getting an error of "Incorrect parameter numbers" (TargetParameterCountException) at line 48 I'm confuse... not sure I can figure this out. Let me know if sending the whole code would help... To explain what I'm trying to do: I have an excel worksheet holding a bunch of inspections. Each...
  5. F

    Question Thread & Listview

    Ok, so I went to read about UI thread and this part much more clear in my head. I did as you mentionned and added: Private Sub AddListItems(list As ListBox, items As String()) list.Items.AddRange(items) End Sub Now the second part is still vague for me, I tried calling the Invoke inside my...
  6. F

    Question Thread & Listview

    Good day, I am trying invoke a Listview and I can't get it to work. I am getting the cross-thread error at line 31 Inspfolder is my variable for passing filepath from an excel worksheet. I manage to get it working if I use: Process.Start("explorer.exe", String.Format(Inspfolder)) But I'd...
  7. F

    Answered Read or get cell value (Excel)

    Alright, so before I head to bed; this is where I'm at. No rush for any answers, get some rest and we'll exploit your brain tomorrow! Until then, this is what I did, I tried making a Thread for Clearalltext and it gave me an error at line 31 and probably all the other lines underneath as showed...
  8. F

    Answered Read or get cell value (Excel)

    This was my 2cent worth of try: Public Class RSIform Dim MonThread As New Thread(AddressOf Rangeloops) Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object) 'Dim MonThread2 As New Thread(AddressOf Clearalltxtboxthread) Private Sub...
  9. F

    Answered Read or get cell value (Excel)

    A lot more clear when I can see it with my eyes. As for the "row = row + 1", you are right, it's useless and I took it out. I also changed Exit for for Exit Sub. Makes more sense that when the value is found, no need to keep looping. Shall I start showing what I had for the Clearalltext() part...
  10. F

    Answered Read or get cell value (Excel)

    Dim values As Object(,) = rg1.Value For i = 1 To values.GetUpperBound(0) 'rows If values(i, 3) = value Then 'update UI TextBox_RDIMS.Invoke(New Callback(AddressOf UpdateUI), TextBox_RDIMS, values(i, 19)) TextBox_RSIG.Invoke(New Callback(AddressOf UpdateUI)...
  11. F

    Answered Read or get cell value (Excel)

    This is where I am : Private Sub ExecuteWork(ByVal value As String) Dim row As Long row = 1 Dim Inspfred As Worksheet Dim Inspchris As Worksheet Dim Inspjr As Worksheet Dim Inspluc As Worksheet Dim Inspted As Worksheet Inspfred = Form1.xlWorkBook.Sheets("Inspfred")...
  12. F

    Answered Read or get cell value (Excel)

    Good Sir, Please note that this is not my first language to start with. It adds in the complexity of things. Also, "Threads" are completely new to me and I have to admit that just reading what it does is making me dizzy. It has nothing to do with the way you are explaining it. You are very...
  13. F

    Answered Read or get cell value (Excel)

    I am trying to adjust the thread and I'm having a cross thread error with line 19 Private Sub ExecuteWork(ByVal value As String) Dim row As Long row = 1 Dim Inspfred As Worksheet Inspfred = Form1.xlWorkBook.Sheets("Inspfred") Dim rg1 As Range 'Range...
  14. F

    Answered Read or get cell value (Excel)

    I got rid of all the other loops and kept: Private Sub Rangeloops() Clearalltextbox() 'Make sure all fields are empty while switching form child to child TextBox_selectednodes.Text = TreeView_Insp_Records.SelectedNode.Text Ping_network() Dim row As...
  15. F

    Answered Read or get cell value (Excel)

    Good coding comes with experience. Experience, well that comes with bad coding :P Hope this is right: Dim i As Long For i = 1 To rg1.Rows.Count 'Range for Inspfred Dim values As Object(,) = rg1.Value If rg1.Cells(i, 3).value =...
  16. F

    Answered Read or get cell value (Excel)

    I'm confuse as do I need to make those changes in the " Private Sub Rangeloops() " where all my orginal loops are, or the " Private Sub ExecuteWork(byval value as string) " which is the thread, or both of them ? I've adapted like this to try but I don't see any significant changes in term of...
  17. F

    Answered Read or get cell value (Excel)

    i have seen post 11. I did not ignored it. I tried but im confused on where and what to change exacly. It doesnt take much as you can see. Could you just show me an exemple with my code in my last post by applying to rg1 ?
  18. F

    Answered Read or get cell value (Excel)

    Imports System.Threading Public Class RSIform Dim MonThread As New Thread(AddressOf Rangeloops) Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object) Private Sub ExecuteWork(ByVal value As String) Dim row As Long row = 1 Dim Inspfred As...
  19. F

    Answered Read or get cell value (Excel)

    Option Explicit On Imports System.Threading Imports Microsoft.Office.Interop.Excel Imports Excel = Microsoft.Office.Interop.Excel Public Class Form1 Dim MonThread As New Thread(AddressOf Rangeloops) Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object) Private...
  20. F

    Answered Read or get cell value (Excel)

    Option Explicit On Imports System.Threading Imports Microsoft.Office.Interop.Excel Imports Excel = Microsoft.Office.Interop.Excel Public Class Form1 Dim MonThread As New Thread(AddressOf Rangeloops) Public Delegate Sub Callback(ByVal s As Control, ByVal v As Object) Private Sub...
Back
Top