Jump to content
Shaik

Changing the extension of file

Recommended Posts

Shaik

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. 

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@Shaik

What did you try so far?


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
AutoBert
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.

Share this post


Link to post
Share on other sites
Shaik

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.

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
jchd

@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.

  • Like 1

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)

Share this post


Link to post
Share on other sites
RTFC

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.

Share this post


Link to post
Share on other sites
Shaik

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

Share this post


Link to post
Share on other sites
Shaik

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

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@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

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
Shaik

it throwing the error @extended = -2147352567

 

Share this post


Link to post
Share on other sites
FrancescoDiMuro

@Shaik
What do you pass to the first command line parameter when you run the script?
Do you already have a "string" which causes the error? :)


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
Shaik

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

Share this post


Link to post
Share on other sites
FrancescoDiMuro

I was thinking to the filename was too long, but seems not to be the case.
Does this error appear for every file do you try to convert, or only some specific ones?


Click here to see my signature:

Spoiler

Thoughts:

  • I will always thank you for the time you spent for me.
    I'm here to ask, and from your response, I'd like to learn.
    By my knowledge, I can help someone else, and "that someone" could help in turn another, and so on.

/*--------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/

ALWAYS GOOD TO READ:

 

Share this post


Link to post
Share on other sites
Shaik

only specific files , and also after  formatting ,

i am unable to close the excel file if i have some files opened and minimized.If it is the only one , then it closing

Share this post


Link to post
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

×