C# does not recognise my file path Windows?

-1

I'm getting an error "The system cannot find the file specified." when running this code of mine:

Excel.Workbook xlWorkBook = xlApp.Workbooks.Open(@"C:\Users\KKeybladeWarrior\PycharmProjects\imagEditor\4k_GRAY.xlsb");

System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified.
Source=

StackTrace:

There are no issues with the path, the name of the file is definitely 4k_GRAY and the extension is definitely '.xlsb', I didn't name it with the .xlsb so there is no issue there.

I have tried with backwards and forward slashes.

I copied and pasted it into windows search and pressing enter opens the file, I even copied the file path from the properties of the file

I even turned read-only for the directory off in case for whatever reason that did something. No effect. I am very confused and looking for any help.

Thanks.

c#
excel
asked on Stack Overflow Sep 9, 2020 by Nathan McHugh • edited Sep 9, 2020 by marc_s

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0