Waiting for another application to complete an OLE action when macro tries to open another workbook

g3orgeluc4s

New Member
Joined
Jun 13, 2013
Messages
1
Hi All,

A little background to the title: I've written a macro that gets called on workbook open. It opens a [shared] workbook on a shared directory and pulls in some information to the workbook the user is using.

Any user working with this sheet already has the shared directory mapped to their computer (and the macro finds the correct drive letter).

I've tested this worksheet multiple times with users in my office. I've also tested it and had two people open the workbooks simultaneously to confirm that the macros for both users are able to pull data from the shared workbook concurrently.

So far, I've had no issues.

This sheet then got rolled out to multiple other users in my company. All in all, about 40 people are expected to use this sheet (not necessarily at the same time.. just in total).

One of the users is located in Poland (I'm located in London).

When he opens the workbook, he gets a 'Microsoft Excel is waiting for another application to complete an OLE action' notification. The notification comes with an 'OK' button. Pressing this button seems to have no effect and the workbook effectively hangs on this notification.


I'm having a lot of trouble resolving this problem as I have not been able to replicate it. Does anyone have an idea why this would come up? Code below:

Code:
Sub PreliminaryDataImport()
    Application.ScreenUpdating = False
    Application.Calculation = xlCalculationManual
    Dim x As Variant
    Dim usename As String
    usename = Environ("USERNAME")
    Dim xlo As New Excel.Application
    Dim xlw As New Excel.Workbook, wkbk As New Excel.Workbook
    Dim xlz As String, regions As String
    Dim LRow As Long, LCell As Long, LRow2 As Long
    Dim RegionList As String
    RegionList = ""
    
    
    xlz = Sheet1.Range("o1").Value & "\Region Planning\TestDB.xlsx"
    Set xlw = xlo.Workbooks.Open(xlz)

If Not Sheet11.Range("S1").Value = xlw.Worksheets("validation") _
        .Range("N1").Value Then
        MsgBox "YOU ARE USING AN OUT OF DATE VERSION" & vbLf & _
            "Please check your inbox or contact xxxx for the current version."
        xlw.Close False
        Set xlo = Nothing
        Set xlw = Nothing
        Call Module7.ProtectSheets
        End
    End If
    
    x = CheckValidation(usename, xlw)
    
'~~ Check to see if User has access to view/modify.
'~~ If they have access, return regions


    On Error Resume Next
    For i = LBound(x) To UBound(x)
        regions = regions + " --- " & x(i)
        RegionList = RegionList + x(i) & ", "
        Sheet1.Cells(i + 2, 33).Value = x(i)
    Next
    If Err.Number <> 0 Then
        MsgBox "You do not have access to view or modify any regions."
        xlw.Close False
        Set xlo = Nothing
        Set xlw = Nothing
        End
    Else
        MsgBox "You have access to view and modify the following regions:" & vbLf _
            & vbLf & regions & "---"

I believe the issue occurs somewhere within this section of the code as the msgbox on the last line doesn't show up prior to the notification. I haven't been able to run in debug from his machine as he's located remotely and that would be a large effort (should only be done if absolutely necessary).


Anyone have ideas on why this one user is getting this error? I'm particularly confused because it's only him having the issue.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,225,169
Messages
6,183,318
Members
453,155
Latest member
joncaxddd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top