New to Python--
My code wont execute Find and Replace after moving the Sheet.
The goal is to bring a new sheet with formulas, then Find and Replace the reference, in the formulas from the 1st book. This will allow the formulas to be live in the second book.
Here is what I have so far. It returns "No Values were found", But they are there.
Any Point in the right Direction will help!
Various Functions
from win32com.client import Dispatch
path1 = (r'C:Full Path\Book1.xlsx')
path2 = (r'C:\Full Path\Book2.xlsx')
xl = Dispatch("Excel.Application")
xl.Visible = True
wb1 = xl.Workbooks.Open(Filename=path1)
wb2 = xl.Workbooks.Open(Filename=path2)
ws1 = wb1.Worksheets(1)
ws2 = wb2.Worksheets(1)
ws1.Copy(Before=wb2.Worksheets(1))
wb1.Close(SaveChanges=True)
#Cant get this part to work
ws2.Cells.Replace('C:Full Path\[Book1.xlsx]','')
Replace.Execute(ReplaceAll=1, Forward=True)
wb2.Close(SaveChanges=True)
xl.Quit()
I think the issue is letting excel know where to execute the Find and Replace.