+ Reply to Thread
Results 1 to 22 of 22

1004 error

  1. #1
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    1004 error

    Hi

    We run this successfully on a several Win10 pc's in my home office. I've set up a new user and get the 1004 error on this one new user and I can't see what's wrong. Any assistance would be much appreciated.
    Please Login or Register  to view this content.
    Thanks, Steven
    Last edited by 6StringJazzer; 07-23-2024 at 10:51 AM. Reason: please use code tags

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: 1004 error

    Check that the value of
    Please Login or Register  to view this content.
    is what you expect and that the user has access to it.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,176

    Re: 1004 error

    Is the activesheet blank?

  4. #4
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi Romperstomper

    We have a two network folders, one for the saved pdf and another for the xlsx files wih permissions set for the user so unsure why it's stopping.

    Or I have I misunderstood what the code is doing?

    Thanks, Steven

  5. #5
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi ByteMarks

    It is blank except for the email address on one the quotation page for testing. The primary address is blank.

    I'm going to test it again and check.

    Thanks, Steven

  6. #6
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi ByteMarks

    I've tried again on a completed spreadsheet and still get the 1004 error.

    Thanks, Steven

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: 1004 error

    Quote Originally Posted by Steven811 View Post
    Or I have I misunderstood what the code is doing?
    No, but absent any context, all I can do is suggest that you verify that the path created by those variables is correct when that user runs the code and that he has access to it.

  8. #8
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Thanks, I will check again.

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,220

    Re: 1004 error

    Please show us the values of variables Path and publicName at the point the error occurs. How is the code assigning values to these?

    I know you think the problem is in this one line of code because that's where the error occurs. But the root cause could be somewhere else. It would help if you showed us all your code. If you do so, please use code tags. (I added them for you in your first post for the sake of keeping things moving forward.)
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  10. #10
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    This is odd. I've changed the user permissions to administrator for testing purposes and still get the 1004 error.

    I'm a bit stuck now.

    Any suggestions always welcome.

    Thanks, Steven

  11. #11
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: 1004 error

    One other thing - does the user have a default printer set up? (Excel historically can be a bit funny about printers)

  12. #12
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi

    The task the code should be performing is to send and save a pdf quotation to a customer. It appears to be failing at the saving bit, although I'm guessing at this. I've removed and added the permissions and still get the error, I've also created the recipient folder on the local drive and still get the error. I can run the same spreadsheet with another user, saving on the network and it works as expected.

    A pdf is attached to an open email in Outlook and waits to be checked and then it's manually sent.

    The failed request neither opens Outlook nor saves the pdf in a designated folder.

    Our spreadsheet is very old and includes many snippets that have been added over the years

    The is the code from the module:

    Please Login or Register  to view this content.
    I had no idea about the printer potentially being an issue but, now added.

    Thanks, Steven
    Last edited by Steven811; 07-24-2024 at 08:45 AM.

  13. #13
    Forum Expert ByteMarks's Avatar
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    3,176

    Re: 1004 error

    There's no path separator between Path and publicName or between pathLocal and savedName, which might be causing an issue.

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,220

    Re: 1004 error

    Definitely causing an issue. Could have identified quickly if we'd had a response to yesterday's post #9.

  15. #15
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: 1004 error

    Or #2 or #7...

  16. #16
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2505
    Posts
    27,220

    Re: 1004 error

    Yes indeed.

  17. #17
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi

    Please accept my apologies.

    I'm unfamiliar with the terms and can't seem to find a clear explanation as to what they are or what is missing.

    My apologies again.

    Regards, Steven

  18. #18
    Forum Contributor
    Join Date
    10-02-2012
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    293

    Re: 1004 error

    Interesting, yesterday the same error appeared on our machines for a similar piece of code. Has there been an update that has affected how Excel exports to PDF?

  19. #19
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: 1004 error

    Not that I'm aware of, though there were a couple of recent generic printer driver bugs that affected sending pdfs via outlook from Access. It's conceivable that could have caused other issues.

  20. #20
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi

    I have compared the code from two of the spreadsheets and they are indentical. A dedicated workbook functions for one user and the other identical workbook doesn't work for the other user.

    We have run both sheets with me as a user on my PC and they work. When I set up one of the other user accounts on my pc both workbooks return the 1004 error.

    I've endeavoured to ensure that the user permissions are set correctly and they appear so but, clearly something is incorrect.

    Please forgive my naive explanation but, I'm new to this and although I really enjoy experimenting, this is driving me mad.

    Thanks, Steven

  21. #21
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,064

    Re: 1004 error

    You never answered my question about the default printer.

  22. #22
    Forum Contributor
    Join Date
    02-17-2005
    Location
    Wokingham
    MS-Off Ver
    365
    Posts
    111

    Re: 1004 error

    Hi romperstomper, there wasn't a default printer set so I added one and the 1004 error issue remained. I've managed to get around it for now by reactivating and renaming an old user.

    I have read that old excel files can be problematic. This file is very old and has had many changes and improvements over the years and I am exploring starting from scratch and rebuilding it.

    Thanks to you and everyone for your advice, much appreciated

    Regards, Steven

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA error: runtime error 1004 : Method range of object - 'Global' failed.
    By Afjio12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 04:37 AM
  2. [SOLVED] I am getting error as "Run Time error '1004' Microsoft excel cannot paste the data
    By Amittapre in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 03-24-2017, 04:40 PM
  3. [SOLVED] Sort Macro Run-time error '1004': Application/Object-defined error.
    By sam1212 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-22-2014, 10:05 AM
  4. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  5. [SOLVED] Getting Error 1004 Object or Application Defined Error - Code to rearrange data
    By BlazzedTroll in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-10-2013, 12:10 PM
  6. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 AM
  7. Error 75 File/Path access error, sometimes Error 1004
    By smokebreak in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-16-2011, 02:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1