相关文章推荐
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. All the research I've done says to reregister Excel by using Command Prompt with \regserver If that is the case I'd love some information on how to do that. I can't find the .exe of the Excel I use. I think I may have to register the entire Microsoft Office considering it came in a pack for my job. Anyways, following the Runtime Error 429, when Debugged, it points to this line
Code:
Set lsh = CreateObject("Excel.Worksheet")
Any thoughts?
P.S. Educate me don't tell me what to do, please
Thank you for taking the time to read this.
Alright that makes sense. Thank you for your input. However, now I'm getting the error message...
Code:
Set lBook = CreateObject("Excel.Workbook")
That's the line it points to with the same error message. Before that I also did this
Code:
Dim lbook As Object
Thoughts?
Alright that makes sense. Thank you for your input. However, now I'm getting the error message...
Code:
Set lBook = CreateObject("Excel.Workbook")
That's the line it points to with the same error message. Before that I also did this
Code:
Dim lbook As Object
Thoughts? Once you create Excel.Application object you can add workbook to Workbooks collection:
Code:
Option Explicit
Private Sub Command1_Click()
Dim objExcel As Object
Dim objBook As Object
    Set objExcel = CreateObject("Excel.Application")
    Set objBook = objExcel.Workbooks.Add
    objExcel.Visible = True
    Set objExcel = Nothing
    Set objBook = Nothing
End Sub
Yeah I got that far I'm just stuck on what to turn Range into. I put it as something that's incorrect I forget what I had it set to before. This is how I have it:
[CODE]Dim oXLApp As Object
Dim oxLBook As Object
Dim oxLSh As Object
Dim oXLRange As Object
Set oXLApp = CreateObject("Excel.Application")
Set oxLBook = lApp.Workbooks.Add
Set oxLSh = lBook.Worksheets(1)
Set oXLRange = lBook.Sheets.Range[\CODE]
And the range part is wrong.
So an awesome thing happened...my computer froze and I lost my work.
So I've been re-doing everything from this morning. Now I'm getting the same 429 but I can't figure out what to change, add, delete, or edit.
Code:
FileName = App.Path & "\PhraseList.xlsx"
Set oXLApp = CreateObject("Excel.Applcation")
oXLApp.Visible = False
Set oXLBook = oXLApp.Workbooks.Open(FileName)
Set oXLSheet = oXLBook.Worksheets("Symptoms")
With oXLSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Not IsEmpty(.cells(i, "A")) Then
            lstSymptoms.AddItem .cells(i, "A")
        End If
    Next i
End With
oXLBook.Close savechanges:=False
oXLApp.Quit
Set oXLApp = Nothing
Set oXLBook = Nothing
Set oXLSheet = Nothing
The line
'DTCS List
FileName = App.Path & "\PhraseList.xlsx"
Set exApp = CreateObject("Excel.Application")
exApp.Visible = False
Set exBook = exApp.Workbooks.Open(FileName)
Set exSheet = exBook.worksheets("DTCS")
With exSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
   For i = 1 To LastRow
   If Not IsEmpty(.cells(i, "A")) Then
        lstDTCS.AddItem .cells(i, "A")
        End If
   Next i
End With
exBook.Close savechanges:=False
exApp.Quit
Set exApp = Nothing
Set exBook = Nothing
Set exSheet = Nothing
'Symptoms to Tip Title
FileName = App.Path & "\PhraseList.xlsx"
Set exApp = CreateObject("Excel.Application")
exApp.Visible = False
Set exBook = exApp.Workbooks.Open(FileName)
Set exSheet = exBook.worksheets("Symptoms")
With exSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Not IsEmpty(.cells(i, "A")) Then
            lstSymptomOne.AddItem .cells(i, "A")
        End If
    Next i
End With
exBook.Close savechanges:=False
exApp.Quit
Set exApp = Nothing
Set exBook = Nothing
Set exSheet = Nothing
'Symptoms to Complaint
FileName = App.Path & "\PhraseList.xlsx"
Set exApp = CreateObject("Excel.Application")
exApp.Visible = False
Set exBook = exApp.Workbooks.Open(FileName)
Set exSheet = exBook.worksheets("Complaints")
With exSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Not IsEmpty(.cells(i, "A")) Then
            lstComplaint.AddItem .cells(i, "A")
        End If
    Next i
End With
exBook.Close savechanges:=False
exApp.Quit
Set exApp = Nothing
Set exBook = Nothing
Set exSheet = Nothing
'Symptoms to Both
FileName = App.Path & "\PhraseList.xlsx"
Set exApp = CreateObject("Excel.Applcation")
exApp.Visible = True
Set exBook = exApp.Workbooks.Open(FileName)
Set exSheet = exBook.worksheets("Symptoms")
With exSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Not IsEmpty(.cells(i, "A")) Then
           lstSymptoms.AddItem .cells(i, "A")
        End If
    Next i
End With
exBook.Close savechanges:=False
exApp.Quit
Set exApp = Nothing
Set exBook = Nothing
Set exSheet = Nothing
'Cause List
FileName = App.Path & "\PhraseList.xlsx"
Set exApp = CreateObject("Excel.Application")
exApp.Visible = False
Set exBook = exApp.Workbooks.Open(FileName)
Set exSheet = exBook.worksheets("Causes")
With exSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Not IsEmpty(.cells(i, "A")) Then
            lstCause.AddItem .cells(i, "A")
        End If
    Next i
End With
exBook.Close savechanges:=False
exApp.Quit
Set exApp = Nothing
Set exBook = Nothing
Set exSheet = Nothing
'Corrections List
FileName = App.Path & "\PhraseList.xlsx"
exApp.Visible = False
Set exBook = exApp.Workbooks.Open(FileName)
Set exSheet = exBook.worksheets("Corrections")
With exSheet
    LastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    For i = 1 To LastRow
        If Not IsEmpty(.cells(i, "A")) Then
            lstCorrection.AddItem .cells(i, "A")
        End If
    Next i
End With
exBook.Close savechanges:=False
exApp.Quit
Set exApp = Nothing
Set exBook = Nothing
Set exSheet = Nothing
End Sub
Please keep each issue to one thread, rather than posting the same issue in 3 different threads - it always wastes peoples time, and even more than usual when have been told what the problem was over an hour before:
http://www.vbforums.com/showthread.p...44#post4191744
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.
 
推荐文章