Automation error when opening shared file with VB

  • I'm working in excel 2010.


    I have a workbook, called Original that opens other temporary workbooks. It copies data from these temporary workbooks into a master tab and then closes them leaving the original workbook open.


    If the temporary workbooks aren't shared, the code runs fine. If they are shared, I get an automation error and the code stops, doesn't go into debug just stops.


    Cant post any of the existing code, its a work thing and I'm not in work today.


    I haven't been able to find any info about why this might happen, is this a known issue or with shared files? Some things I've read say that sharing of workbooks isn't very well implemented in excel.


    Is there some code that will check to see if the temporary workbook is shared, if it is turn sharing off when it opens the file and back on when it closes?

  • Re: Automation error when opening shared file with VB


    Couldn't you open the workbooks as Read Only?

    Code
    Workbooks.Open "Temp.xlsx", readonly:=True

    If I've been helpful, let me know. If I haven't, let me know that too. 

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!