File format and extention dont match when opening file (1 Viewer)

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
I have a file that is exported out of OBI, and sent to me on a weekly basis.

I have set up With power automate that when the file is received then it saves it automatically in a folder - This part works with no issues.

When i open the file, i get a message that the file may be corrupt "The format and extension of XXX Dont match, The fie could be corrupt or unsafe."

Ideally what i want to do within Access is link into the file, but because of the warning message i cannot create the link, so i have to open the file and save as a xlsx file, and then link to that file.

This works, but i am trying to look at how to automate the opening, and saving so this can be carried out as a task overnight.

Can i set up a task to open up the file and ignore the error message ?
Then Save the file to another Filename ?

Any thoughts on the best way to do this ?

I have asked about changing the format of the original file to be told, we cant and everyone who opens the files from the system have the same error message.

Appreciate any ideas.
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:03
Joined
Sep 21, 2011
Messages
9,276
You do not say what the original extension is, or what you use to open file and save it with?, assuming excel?, so if that is the case use vba?
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
sorry, my bad. it is a xls file, would vba be able to ignore the error message i get when trying to open ?
Screenshot_20210923-201724_Amazon WorkSpaces.jpg
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:03
Joined
Sep 21, 2011
Messages
9,276
Just try renaming with xlsx extension?
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:03
Joined
Mar 14, 2017
Messages
5,886
Are you sure that the file Power Automate is downloading, IS (originally), an .xls? not .xlsx or .xlsm or .xlsb?
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
I have tried using xcopy and got the message "could not expand the 2nd filename to match the first"

I tried just by changing the file format, and i get the same originl error.

If i open the file and saave as xlsx then it is fine.
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
Are you sure that the file Power Automate is downloading, IS (originally), an .xls? not .xlsx or .xlsm or .xlsb?
yes, i get a copy of the file to my inbox, i have just set up the rule to save the attachment in a folder.

When i open the fil ein my inbox i get the same error message.
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
the error "could not expend the 2nd filename to match the first" is due to the length of the extension is different ie going from xls to xlsx.

I have crated a copy of the file, with a different filename, keeping as a xls file and still get the original error.
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:03
Joined
Sep 21, 2011
Messages
9,276
Just try renaming with xlsx extension?
Just try renaming with xlsx extension?
Just try renaming with xlsx extension?
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
interesting - Tried to copy to a CSV file - Failed - but enabled me to read this message .

This document is a Single File Web Page also known as a Web Archive file. If you are seeing this message your browser or editor doesn't support Web Archive files. Please download a browser that supports Web Archive.
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:03
Joined
Mar 14, 2017
Messages
5,886
I think your problem might be in the Flow, therefore you should consider creating a post in the Power Automate section of AWF.
 

Gasman

Enthusiastic Amateur
Local time
Today, 00:03
Joined
Sep 21, 2011
Messages
9,276
tried, and does not work
So the next step I would take is automate what you do manually.
However who on earth names a web archive file with an xls extension? 😠
Might be worth finding out what that extension should really be?, however automation appears to be the easiest option.
tried, and does not work
 

Isaac

Lifelong Learner
Local time
Yesterday, 16:03
Joined
Mar 14, 2017
Messages
5,886
I've created a flow that saved email attachments and had this problem because a file that wasn't *really* the attachment I was looking for (you know how Automation of any kind sometimes 'sees' more attachments than we think of - like signature ole pics, etc) and was saving something that wasn't my excel attachment.

@tucker61 check if the saved file (the one your flow saves) is the correct size.
 

CJ_London

Super Moderator
Staff member
Local time
Today, 00:03
Joined
Feb 19, 2013
Messages
13,542
Can you upload an example of the file as you receive it. Sounds like it is not a true .xls.

also given the message perhaps you should try html

and what version of access are you using?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 08:03
Joined
May 7, 2009
Messages
14,555
I think your problem might be in the Flow, therefore you should consider creating a post in the Power Automate section of AWF.
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
Sorry i cant upload a copy of the file as it contains financial information, If i change the file extension to MTH, then the file opens in Chrome with no warnings, if i try HMTL, then i get the error "could not expend the 2nd filename to match the first" is due to the length of the extension is different.

Next - I will look at a macro, to open the file and save as a xlsx. see if that works.
 

tucker61

Registered User.
Local time
Yesterday, 16:03
Joined
Jan 13, 2008
Messages
265
in the end - i created the macro to open and save as a xlsx. This worked, now i have set up a task to automate this part for me. So far working as planned. Thanks for all the help and advice.
 

Users who are viewing this thread

Top Bottom