0

I need to update values in an existing excel file.

I need to open an existing file. I need to update for example the cell value in row 4 column A. I need to close and save the existing file.

I have tried a simple code but it returns an error.

CHECK MY CODE

EDIT: the code from the image works and executes but when i open the Excel file excel returns an error.

3
  • what does copy method does in your code ? is it copy module ? Commented Sep 18, 2019 at 17:07
  • stackoverflow.com/questions/2725852/… may be useful. My own experiences were with .xls files so that may not be helpful - when working with those it was only possible if your input file was simple enough, because some formatting information got lost between opening the input file and creating a writeable version. But the .xslx format is different enough that that may not hold. Commented Sep 18, 2019 at 17:11
  • I don't know actually. I followed a tutorial which included it. Commented Sep 18, 2019 at 17:14

1 Answer 1

1

workable_copy = copy(read_excel)

TypeError: 'module' object is not callable

This message means that you're calling a module as though it were a function. Since your script recognizes copy as a module, I assume you've imported it with import xlutils.copy. However, if you want to use the function without qualifying it, you have to import it like this:

from xlutils.copy import copy
Sign up to request clarification or add additional context in comments.

3 Comments

Just guessing, but this is probably meant to be the xsutils.copy copy method - xlutils.readthedocs.io/en/latest/copy.html
@PeterDeGlopper Oh yeah, that is a better guess.
I got the code to compile and execute but when I open the resulting excel file, excel returns an error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.