- #This workbook has lost its vba project excel 2016 code#
- #This workbook has lost its vba project excel 2016 windows 7#
Thanks for helping make community forums a great place. We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. If the steps above do not give you help, since I can't reproduce the issue, suppose it is related to the workbook named "workbook1.xls", would you mind uploading it through OneDrive? If there was already a workbook named "workbook2" and it was opened, I would get such result: > The workbook you are trying to save has the same name Workbooks.Open Filename:="C:\Users\v-junhua\Desktop\test.xls", UpdateLinks:=False, ReadOnly:=TrueĪctiveWorkbook.SaveAs Filename:="C:\Users\v-junhua\Desktop\workbook2.xlsx", FileFormat:=xlOpenXMLWorkbook, ReadOnlyRecommended:=Falseīy another program.
#This workbook has lost its vba project excel 2016 code#
ThereĪre no IIS or Sharepoint or network locations involved, the common associations for this error.Īccording to my investigation in Office 2007 and Windows 7, the code would work fine. While in the example above I put two specific filenames, this happens with every single workbook I try. Neither of the 3 possible reasons are correct.
#This workbook has lost its vba project excel 2016 windows 7#
I'm on Office 2007 SP3 and Windows 7 SP1 x86. This very simple code should work fine, but it fails. The B6E79B00 part obviously refers to the temp file name that Excel creates in the same folder whenever a file is opened. The workbook you are trying to save has the same name as a currently open workbook.The file is being used by another program.Microsoft Office Excel cannot access the file 'C:\Users\myuser\Documents\B6E79B00'.
![this workbook has lost its vba project excel 2016 this workbook has lost its vba project excel 2016](https://exceloffthegrid.com/wp-content/uploads/2020/02/Project-Properties-Protection.png)
That code yields this error when trying to execute the second line:
![this workbook has lost its vba project excel 2016 this workbook has lost its vba project excel 2016](https://www.planware.org/images_ep/2007_trust_center.gif)
![this workbook has lost its vba project excel 2016 this workbook has lost its vba project excel 2016](https://i.stack.imgur.com/4Y2tP.png)
> The workbook you are trying to save has the same name as a currently open workbook. Make sure that there was no Excel process existed before executing the code. I would suggest you checking task manager. Workbooks.Open FileName:="C:\Users\myuser\Documents\workbook1.xls", UpdateLinks:=False, ReadOnly:=TrueĪctiveWorkbook.SaveAs FileName:="C:\Users\myuser\Documents\workbook2.xlsx", FileFormat:=xlOpenXMLWorkbook, ReadOnlyRecommended:=False If I opened an existing workbook named 'test.xls', the code also would work. I have a very simple code in VBA that inexplicably fails in the immediate window.