The user of my Excel workbook with VBA

Eric Penfold

Active Member
Joined
Nov 19, 2021
Messages
431
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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Are you sure that's where the error is? That doesn't really make sense for that error message.
 
Upvote 0
Could i send my workbook to you.
Problem is it works fine with my PC then on the users one it does not work.
Maybe if i send it to you it might highlight the issue.
 
Upvote 0
Before we do that, what references do you have set in the workbook's project (Tools - References in the VB Editor)?
 
Upvote 0
I have all the Microsoft Object library's ticked &
OLE Automation
Microsoft Shell Controls & Automation
Microsoft Scripting runtime ticked
 
Upvote 0
Just a thought. Maybe, in the other PC, the "Microsoft Shell Controls & Automation" library is marked as Missing in Tools\References and will need to be resolved (unticked).

I use WIN x64bit and the Shell32.dll file is located in the Windows\SysWow64 folder (not in the Windows\System32 as one would expect) ... I would check in both locations.

Also, note that calling the ShellExecute api function in code, doesn't need an explicit reference to the Microsoft Shell Controls & Automation library.
 
Upvote 0
If you uncheck the Shell controls reference, does the code still work on your machine?
 
Upvote 0
How are you printing? There shouldn't be any link between the two.
 
Upvote 0

Forum statistics

Threads
1,223,238
Messages
6,170,939
Members
452,368
Latest member
jayp2104

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