Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21845

[RESOLVED] Error when opening excel file with Windows 7 Pro

$
0
0
Hi,

I have a VB6 app that worked fine on Windows XP and Excel 2007. Now they upgraded to Windows 7 Pro and Office 2010. When it goes to use excel I get the error that this action cannot be completed because the other application is busy. I looked this up and several sites mention the OLEReqiestPendingTimeout property to set to 0. That property is not available under Application like Microsoft mentions. Can someone tell me what I need to do to make this work? My references are to Microsoft Excel 12.0 Object Library and I am creating an instance like below:

Code:

    Dim xlsApp As Excel.Application
    Dim xlsWBook As Excel.Workbook
    Dim xlsWSheet As Excel.Worksheet
    Dim i, j As Integer
   
    ' Get or Create Excel Object
    On Error Resume Next
    Set xlsApp = GetObject(, "Excel.Application")

    If Err.Number <> 0 Then
        Set xlsApp = New Excel.Application
            Err.Clear
    End If

   
    ' Create WorkSheet
    Set xlsWBook = xlsApp.Workbooks.Add
    Set xlsWSheet = xlsWBook.ActiveSheet

Thanks!

Viewing all articles
Browse latest Browse all 21845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>