Results 1 to 3 of 3

Thread: Excel Crapy

  1. #1

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901

    Excel Crapy

    I am automating excel thu code because I want to keep it hidden.
    problem is if I click on an excel spreadsheet, my hidden sheet pops open ***. I have never run across this b4. Does anyone know how to stop this from happening?

    Seahag

  2. #2
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    You will have to post your code and then ask question(s).
    McGenius

  3. #3

    Thread Starter
    Fanatic Member SeaHag's Avatar
    Join Date
    Jul 2001
    Location
    Lake Huron
    Posts
    901
    ist not really that difficult

    VB Code:
    1. Option Explicit
    2. Dim xlSheet As Excel.Application
    3.  
    4. Dim pathname As String
    5.  
    6. Private Sub Combo1_click()
    7. Call goSetGet
    8. End Sub
    9.  
    10. Private Sub Combo2_click()
    11. Call goSetGet
    12. End Sub
    13.  
    14. Private Sub Combo3_click()
    15. Call goSetGet
    16. End Sub
    17.  
    18. Private Sub Form_Load()
    19.  
    20. Dim Tempath As String
    21.     Tempath = Environ("temp")
    22.     pathname = Tempath & "\" & "termpro.ter"
    23.    
    24.   Call ExtractFiles(Tempath, "ter", "termpro")
    25.    
    26. Set xlSheet = CreateObject("Excel.Application")
    27. xlSheet.Workbooks.Open (pathname)
    28. xlSheet.DisplayAlerts = False
    29.  
    30. xlSheet.Worksheets(1).Range("b5").Value = Combo1.Text  ' Dia wheel
    31.  
    32. xlSheet.Worksheets(1).Range("c5").Value = Text1.Text 'RPM
    33. xlSheet.Worksheets(1).Range("e5").Value = Combo2.Text ' Shot Size
    34. xlSheet.Worksheets(1).Range("f4").Value = Combo3.Text 'Almen
    35. Dim duh
    36.  duh = Round(CDec(xlSheet.Worksheets(1).Range("f5").Value), 4) ' arc Height
    37.  Label9 = Format(duh, "##,##0.0000") & Chr(34) & "  (" & Format(duh * 25.4, "##,##0.0000") & "mm)"
    38.  SpinButton1 = 3600
    39. End Sub
    40.  
    41. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    42. xlSheet.Workbooks("termpro.ter").Close savechanges:=False
    43. xlSheet.Quit
    44. Set xlSheet = Nothing
    45. End Sub
    46.  
    47. Sub goSetGet()
    48. xlSheet.Worksheets(1).Range("b5").Value = Combo1.Text  ' Dia wheel
    49. xlSheet.Worksheets(1).Range("c5").Value = Text1.Text 'RPM
    50. xlSheet.Worksheets(1).Range("e5").Value = Combo2.Text ' Shot Size
    51. xlSheet.Worksheets(1).Range("f4").Value = Combo3.Text 'Almen
    52.  
    53. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    54.  Combo1.Text = xlSheet.Worksheets(1).Range("b5").Value ' Dia wheel
    55.  Text1.Text = xlSheet.Worksheets(1).Range("c5").Value 'RPM
    56.  Label10 = xlSheet.Worksheets(1).Range("d5").Value ' Veloc
    57.  Combo2 = xlSheet.Worksheets(1).Range("e5").Value ' Shot Size
    58.  Combo3 = xlSheet.Worksheets(1).Range("f4").Value 'Alemn
    59. Dim duh
    60.  duh = Round(CDec(xlSheet.Worksheets(1).Range("f5").Value), 4) ' arc Height
    61.  Label9 = Format(duh, "##,##0.0000") & Chr(34) & "  (" & Format(duh * 25.4, "##,##0.0000") & "mm)"
    62.  
    63. End Sub
    64.  
    65.  
    66.  
    67.  
    68. Private Sub SpinButton1_Change()
    69. Text1.Text = SpinButton1
    70. goSetGet
    71.  
    72. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width