The user of my Excel workbook with VBA

Eric Penfold

Active Member
Joined
Nov 19, 2021
Messages
424
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
When the user tries to use the workbook it says "Can`t find Project or Library"??
Why is this??

This is where is shows an error

VBA Code:
#If VBA7 Then
    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
        ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, _
        ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr
#Else
    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
                                      (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, _
                                       ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
#End If
Const SW_HIDE            As Long = 0&
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
This is the code below is stops working on
VBA Code:
StrConv

Says error "Can`t find Project or Library"
VBA Code:
#If VBA7 Then
    Private Declare PtrSafe Function StrCmpLogicalW Lib "shlwapi.dll" (ByVal string1 As String, ByVal string2 As String) As Long
    #End If
Public Sub Insertion_Sort(ByRef arr As Variant)

    Dim i As Long, j As Long
    Dim temp As String

    For i = 1 To UBound(arr)
        temp = arr(i)
        For j = i To 1 Step -1
            If StrCmpLogicalW(StrConv(arr(j - 1), vbUnicode), StrConv(temp, vbUnicode)) = 1 Then
                arr(j) = arr(j - 1)
            Else
                Exit For
            End If
        Next
        arr(j) = temp
    Next

End Sub
 
Upvote 0
That's definitely a references error. Can you get the user to check the references with the workbook open on his machine? One of them will be prefixed with 'MISSING:' in the list.
 
Upvote 0
It needs to be done on his machine. Then check in the VB Editor under Tools - References.
 
Upvote 0
What did the References dialog look like?
 
Upvote 0
There has to be a missing reference for you to get that error. Change the code to use VBA.StrConv which should rectify that, but you still have a missing reference which will probably affect other code.
 
Upvote 0

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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