Error code 2302 on individual machine (1 Viewer)

U226RM2

Registered User.
Local time
Today, 13:25
Joined
Oct 29, 2007
Messages
16
Hello all

I have a macro set up which exports items from a query into an excel spreadsheet so it can be emailed easily. One of my colleagues was able to do this on Monday, but since then she has been getting an error message 2302 and it won't export the data. (The macro works on her desktop but not on her laptop, BTW). I've changed the macro to try and export as text and PDF with no success from her laptop. Also, I can run the macro from my laptop.

Any help gratefully received.
 

Ranman256

Well-known member
Local time
Today, 09:25
Joined
Apr 9, 2015
Messages
4,339
show the code. we cant guess.
it could be the filename. you cant use drive letters if they are not setup on the PC.
ALWAYS use UNC paths.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:25
Joined
Sep 21, 2011
Messages
14,041
I have a piece of string, but it is too short. How long should it be? :)
 

U226RM2

Registered User.
Local time
Today, 13:25
Joined
Oct 29, 2007
Messages
16
Thanks, the drive is mapped to the correct letter on the laptop (and it worked for her on Monday). No idea of the code but here is the first part of the macro in design view.

Capture.PNG
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:25
Joined
May 7, 2009
Messages
19,169
if the folder "Drive:\Microbiology\IC Daily ALERT LIST" is mapped To F:,
you just use:

F:\community list for sending3.xls
 

U226RM2

Registered User.
Local time
Today, 13:25
Joined
Oct 29, 2007
Messages
16
It isn't, everything before \Microbiology is mapped to F.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 21:25
Joined
May 7, 2009
Messages
19,169
and where it is mapped?
you must re-create same folder path as with the mapped drive +\Microbiology\IC Daily ALERT LIST (folder).
 

U226RM2

Registered User.
Local time
Today, 13:25
Joined
Oct 29, 2007
Messages
16
and where it is mapped?
you must re-create same folder path as with the mapped drive +\Microbiology\IC Daily ALERT LIST (folder).
Thanks but I don't think this is the problem, it works on everyone else's machines and it worked for her on MOnday.
 

Gasman

Enthusiastic Amateur
Local time
Today, 13:25
Joined
Sep 21, 2011
Messages
14,041
Is the file open somewhere?
Is an Excel instance running at all?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:25
Joined
Feb 28, 2001
Messages
26,998
Error 2302 is "Can't save to the file you have specified." Therefore you have to consider
- bad file name
- bad path
- incorrect permissions
- missing reference to Excel (because the "Export" function uses the Excel library).

Since it works on the desktop but not the laptop, that eliminates the name and path issues. The ability to save outside of the context of Access eliminates the permissions issues. That makes me think the laptop doesn't have proper references set up. And unlike permissions and naming issues, references are specific to individual machine since they are at least partly a registry function from the HKLM (EDIT: or the HKCU) hive.

Therefore, open up the app on the laptop and somehow get to the VBA coding page so you can follow Tools>>References to assure that the references checked there match the ones checked on the desktop.
 
Last edited:

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 13:25
Joined
Sep 12, 2006
Messages
15,613
We had an issue the other day where Access could not delete or overwrite a readonly file. (I mean reported on this forum)
It turns out that it just cant; do this.

It was a low error number though. Error 75 - I just looked it up
 

Users who are viewing this thread

Top Bottom