Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. 10Miler

    Method '~' of object '~' failed error

    I figured it out! There is a setting in Excel to disable add-ins. You have to add the Developer tab to the ribbon in MS Excel 2007. Then you go to Excel Options, then Add-ins. Check the box to disable add-ins. WOOHOO!
  2. 10Miler

    Method '~' of object '~' failed error

    I removed all references to Excel, and it doesn't work. I am using late binding, but this is in my existing project. I guess I will need to make up a dummy project.
  3. 10Miler

    Method '~' of object '~' failed error

    Well, I put the ExcelApp.Visible before the Workbooks.Add code and it opens Excel, then throws the error on the Add line. The workbook sheet does open though.
  4. 10Miler

    Method '~' of object '~' failed error

    Ok, I got 2007 installed on my dev machine. Made sure the reference was pointing to MS Excel 12 Object Library. Recompiled and it still bombs! AHHH!!!
  5. 10Miler

    Method '~' of object '~' failed error

    FYI, the code bombs at this line: Set WorkBook = ExcelApp.Workbooks.Add(xlWBATWorksheet) That is consistent with my original code. It bombs at the Workbook.Add part. I will look at the GetObject and CreateObject link. Thanks!
  6. 10Miler

    Method '~' of object '~' failed error

    dilettante, A guy I work (with Excel 2007) with gets the same error when trying to run the .exe. But there is another person that has 2007 and doesn't have a problem. strongm, Are you compiling and running on the same machine? I am compiling on a machine with Excel 2003, and running on a...
  7. 10Miler

    Method '~' of object '~' failed error

    dilettante, I just copied that code into my app and it produces the same error. What now?
  8. 10Miler

    Method '~' of object '~' failed error

    dilettante, Yes it fails with Excel 2007. I will try that code in my app.
  9. 10Miler

    Method '~' of object '~' failed error

    Roy, I don't think any of those things are causing the problem. This app has worked well for years. Then I get Office 2007 on my computer and I get this error. It would seem to be a version dependency issue, but I'm not sure.
  10. 10Miler

    Method '~' of object '~' failed error

    Ok, here you go. Private Sub ThisReportInExcel 10 On Error GoTo ThisReportInExcel_Error ' Declare our Excel objects. Dim MyCMD As New ADODB.Command Dim param As ADODB.Parameter Dim Myrs As ADODB.Recordset Dim MyExcel As Object Dim MyWorkbook...
  11. 10Miler

    Method '~' of object '~' failed error

    Still not working.
  12. 10Miler

    Method '~' of object '~' failed error

    Ok, I am changing ActiveSheet to Sheets(1).
  13. 10Miler

    Method '~' of object '~' failed error

    Ok, I have declared all of the objects as Object and dropped the reference to the Excel Object Library. I still get the same error. Do I need to set the objects with CreateObject? I am only using CreateObject with the MyExcel object.
  14. 10Miler

    Method '~' of object '~' failed error

    After searching I found out that I should change this line Set MyExcel = New Excel.Application to this Set MyExcel = CreateObject("Excel.Application") Is that all I need to do?
  15. 10Miler

    Method '~' of object '~' failed error

    Ok, with my example how would I use late binding?
  16. 10Miler

    Method '~' of object '~' failed error

    It appears that I need the Microsoft Excel 12 Object Library. http://support.microsoft.com/kb/219151
  17. 10Miler

    Method '~' of object '~' failed error

    Andrjezek, It does point to the Microsoft Excel 11.0 Object Library. Is that what is causing the error? FYI, I have the code in line 70 (from your post) later in my code.
  18. 10Miler

    Method '~' of object '~' failed error

    Sorry, the Set MyWorkbook line!
  19. 10Miler

    Method '~' of object '~' failed error

    Line 50, the Set Workbook line. 10 Dim MyExcel As Object 20 Dim MyWorkbook As Object 30 Dim MyWorksheet As Excel.Worksheet 40 Set MyExcel = New Excel.Application 50 Set MyWorkbook = MyExcel.Workbooks.Add 60 Set MyWorksheet = MyWorkbook.ActiveSheet
  20. 10Miler

    Method '~' of object '~' failed error

    I get this message when trying to open an excel file in my VB6 application. It just started happening since I got a new PC with Excel 2007 on it. The excel file is being built dynamically by the app.

Part and Inventory Search

Back
Top