Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read values after I use UpdateLinkedValue #157

Closed
valasek opened this issue Nov 19, 2017 · 3 comments
Closed

Cannot read values after I use UpdateLinkedValue #157

valasek opened this issue Nov 19, 2017 · 3 comments

Comments

@valasek
Copy link

valasek commented Nov 19, 2017

Open an xlsx file, update one or more values. If excel has functions you should use UpdateLinkedValue function. But If call UpdateLinkedValue all calls using GetCellValue returns "".
When I update excel and do not use UpdateLinkedValue values are updated and I can use excelize to read data without any issues. I tested this case.

Using Open XML SDK Tools I have found differences in all sheet xmls.

Example diff from sheet xml file:

   <c r="F13" s="53" t="str">
    <f>
     IF(WEEKDAY($E$9)=1,$E$9,"N/A")
    </f>
    <v>
     N/A
    </v>
   </c>

vs

   <c r="F13" s="53">
    <f>
     IF(WEEKDAY($E$9)=1,$E$9,"N/A")
    </f>     
   </c>

or

   <c r="I13" s="54">
    <f>
     IF(H13="N/A", IF(WEEKDAY($E$9)=4,$E$9,"N/A"), H13+1)
    </f>
    <v>
     43040
    </v>
   </c>

vs

   <c r="I13" s="54">
    <f>
     IF(H13="N/A", IF(WEEKDAY($E$9)=4,$E$9,"N/A"), H13+1)
    </f> 
   </c>

@xuri, relevant files sent via email.

@xuri
Copy link
Member

xuri commented Nov 21, 2017

Thanks for your issue. The function UpdateLinkedValue actually removes the <v> tags from the XML. It be used to store the "cached results" generated by the Excel application when it is saved. After removes the <v> tags, it will be recalculated when the file is open again in Excel application. Recalculation requires Excel application. Excelize library doesn't implement the formula calculation engine currently (reference #65). So we will get a blank value using the function GetCellValue after call UpdateLinkedValue.

@valasek
Copy link
Author

valasek commented Nov 22, 2017

OK, I this case I am closing an issue as a duplicate to #65.

@valasek valasek closed this as completed Nov 22, 2017
@Beilusquit90
Copy link

Big thank for answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants