Results 1 to 6 of 6
  1. #1
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98

    Excel Export keeps opening as read only.

    Here is my code currently:
    Code:
    Set excelexport = CreateObject("Excel.Application")
    
    SetAttr "C:\Users\Me\Desktop\My Documents\Macros\JobClassSaleID.xlsm", vbNormal
    
    excelexport.workbooks.Open ("C:\Users\Me\Desktop\My Documents\Macros\JobClassSaleID.xlsm")
    
    excelexport.Visible = True
    I feel like I've tried everything. SetAttr doesn't seem to change anything with or without it. It always opens as read only even if I set:



    Code:
    excelexport.workbooks.Open ("C:\Users\Me\Desktop\My Documents\Macros\JobClassSaleID.xlsm"), ReadOnly:=False
    I've also tried completely disabling Protected View.

  2. #2
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    Now I just tried:
    Code:
    excelexport.workbooks.Open ("C:\Users\dschulz\Desktop\Dave's Documents\Macros\JobClassSaleID.xlsm"), IgnoreReadOnlyRecommended:=True
    Still didn't work.

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    I presume you haven't already got the workbook open in excel?

  4. #4
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    Quote Originally Posted by Ajax View Post
    I presume you haven't already got the workbook open in excel?
    That is correct.

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Never seen nor used SetAttr and my code opens editable wb.

    Try declaring and setting a workbook object variable.

    Do you have more code to manipulate workbook? If not and you just want to open file, there are other methods. Review http://allenbrowne.com/func-GoHyperlink.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    schulzy175 is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Oct 2017
    Posts
    98
    I figured it out. Even though there no excel files showing open, there were still EXCEL.exe in task manager that I had to kill. After I ended the process for it, it worked just fine. Definitely something to notate in the future.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Word opening in read only when loading from Access
    By andrewhoddie in forum Access
    Replies: 3
    Last Post: 06-08-2016, 02:27 PM
  2. Replies: 2
    Last Post: 04-29-2016, 08:43 AM
  3. Opening as read-only even with full rights?
    By mattetc in forum Access
    Replies: 5
    Last Post: 12-04-2015, 11:05 AM
  4. Export Access data to Excel as Read-only
    By rmmhie in forum Import/Export Data
    Replies: 1
    Last Post: 10-26-2013, 07:44 AM
  5. Access 2010 form opening as read only
    By tracer in forum Forms
    Replies: 5
    Last Post: 02-10-2012, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums