Python Forum
Saving as docx file from excel with new filename
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Saving as docx file from excel with new filename
#4
sorry, it's clear mistake on my part - I just copied your full path and forgot to remove the file name
import os
src_path = r'C:\Users\Ron McMillan\Desktop'
src_file = os.path.join(src_path, 'demo1.xlsx')
dest_file = os.path.join(src_path, f'{new_invoice_number}.xlsx')
print(src_file)
print(dest_file)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: Saving as docx file from excel with new filename - by buran - Oct-03-2019, 06:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Python openyxl not updating Excel file MrBean12 1 503 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Copy Paste excel files based on the first letters of the file name Viento 2 595 Feb-07-2024, 12:24 PM
Last Post: Viento
  no module named 'docx' when importing docx MaartenRo 1 1,261 Dec-31-2023, 11:21 AM
Last Post: deanhystad
  Search Excel File with a list of values huzzug 4 1,418 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Updating sharepoint excel file odd results cubangt 1 1,013 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  Replace a text/word in docx file using Python Devan 4 4,320 Oct-17-2023, 06:03 PM
Last Post: Devan
  output provide the filename along with the input file processed. arjunaram 1 1,010 Apr-13-2023, 08:15 PM
Last Post: menator01
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,240 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Save and Close Excel File avd88 0 3,421 Feb-20-2023, 07:19 PM
Last Post: avd88
  Trying to access excel file on our sharepoint server but getting errors cubangt 0 914 Feb-16-2023, 08:11 PM
Last Post: cubangt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020