Jump to content

Changing the extension of file


Shaik
 Share

Recommended Posts

How to change the extension of excel file(from xls to xlsx) after downloading it. After clicking on download button, Excel file with the extension of xls is downloaded (I am using ie). After clicking on save as button on window pop-up, after changing the file name, can I change the file extension from below file type drop down. 

Link to comment
Share on other sites

2 hours ago, Shaik said:

How to change the extension of excel file(from xls to xlsx)

Have you ever tried what happens after changing it in explorer, i suggest use _Excel_Open and _Excel_Save. After savinf you can delete the original. All other ways the excel files could be damaged.

Link to comment
Share on other sites

After clicking on download button , excel window popup will appear . using my auto it script , i am clicking on 'save as' option under the save button and changing the file name in 'File Name' textfield and in 'File type' i am unable to see the  xlsx file extension option. could you please suggest me how can i change the file extension to xlsx after downloading it.

Link to comment
Share on other sites

@Shaik

@AutoBert suggested to you a valid solution.

When I did ask "What did you try so far?", I was meaning "Show us what you tried, in order to see how we can help you".

When you ask for help, always post the code you are working with OR a valid reproducer of it.

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

@Shaik,

Changing *.xls into *.xlsx isn't simply changing the extension, it's mainly changing the file format. Only Excel (and other spreadsheet compatible programs like Libre Office) can read *.xls and convert into *.xlsx.

Same as if you get from some link a text file, say "story.txt". Storing it under "story.pdf" will not automagically make it a PDF file!

So go with what @AutoBert suggested: save the .xls, open it with AutoIt _Excel_* functions and save it with the other .xlsx format.

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Link to comment
Share on other sites

The additional x-suffix in Office extensions indicates compressed content, making the stored file on disk smaller than when working on it in memory. You can use an extraction utility such as 7-zip on such a file to extract, producing a subdirectory structure (a test .pptx of mine produced subdirs _rels, docProps, and ppt (the latter comprising subdirs _rels, diagrams, drawings, embddings, media, slideLayouts, slideMasters, slides, and theme) , plus a master .xml file.

Link to comment
Share on other sites

Thanks for the valuable suggestions , i changed the excel file with extension xls to xlsx using Auto_Excel Save functions after downloading the file using automation selenium.

It is working fine . 

thanks again

Link to comment
Share on other sites

  • 1 month later...

hi guys,

i worte the script which will convert xls to xlsx . all this time it is working fine now it is saying that 'Error Saving to Workbook' @error = 5 

Sometimes it will convert , sometimes it will throw the above error

I am attaching the auto it script for your reference , please guide me  in  resolving this issue. 

Thanks in advance

XlsToXlsx.au3

Link to comment
Share on other sites

@Shaik
As the Help file says about the error code returned from _Excel_BookSaveAs() function:

5 - Error occurred when saving the workbook. @extended is set to the COM error code returned by the SaveAs method.

Try to ConsoleWrite() the @extended code too, so you can see in detail what kind of error do you have with the function :)

Click here to see my signature:

Spoiler

ALWAYS GOOD TO READ:

 

Link to comment
Share on other sites

C:\Users\MasthanS\Perforce\InfactWorkspace\QAAutomation_FS\Infact\Automation_FactoryLogger\testData\08-10-2018\Run10\FactoryLogger_SmokeSuite\ShiftTest\ShiftSmokeTest\tc009\Intervaltc009_08_10_2018_22_17_18

 

I am passing the above path in cmdline[1], after formatting i am giving the same path for the formatted file also

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...