Excel 2007 File Extension Error


B

beginner1.mat

I changed a .txt file to be saved with a .xls extension. If I try
opening the file in Excel, I get an error saying "the file has a
different extension than specified by the file extension....verify if
the file is not corrupted...do you want to open file?" Then, if I
click "Yes", Excel will open the file in good format. It seems like
the problem is that the file is not recognized by Excel as a .xls, but
opens it without any errors. If I open the file and saveas a .xls,
then the next time it opens up fine.

Is there a way around this, or some setting that can be changed in
Excel that does not prompt this for ever file that I have? Thanks!
 
Ad

Advertisements

T

Tyro

How did you change a .txt file to be saved with a .xls extension? Also, the
error mention you mention does not make sense.

Tyro
 
B

beginner1.mat

How did you change a .txt file to be saved with a .xls extension? Also, the
error mention you mention does not make sense.

Tyro

I changed the names of the extension using the command window (Run =>
cmd). For example, at the c-prompt: "ren file1.txt file1.xls".

As for the error message, I retyped it as follows:"

The file you are trying to open, 'file1.xls', is in a different format
than specified by the file extension. Verify that the file is not
corrupted and is from a trusted source before opening the file. Do
you want to open the file now?"

When I click yes to open the file, the file opens up fine. I just do
not want to do this for the thousands of files that I have and was
wondering if there is a fix or anything I can do. Thanks for the
help.
 
T

Tyro

You should not change file extensions like that. You're asking for trouble.
File extensions are used to indicate what type of file the file is and what
application created the file. Many applications create files in formats that
they understand and that other applications do not understand. .xls files
are created by Excel. Excel is also capable of creating .csv files. Other
applications can create .csv files too. .csv files are intended to be used
to allow easy transfer of data between applications. The format of a .xls
file and a .csv file are not the same at all. That is why Excel is giving
you the error message and it always will. The proper way is to load your
..csv file into Excel or import it into an Excel worksheet and save it as an
Excel workbook which will have a .xls extension.

Tyro
 
B

beginner1.mat

Correction. When I referred to .csv files in my response, I meant .txt.

Tyro






- Show quoted text -

I realize this is not the best, or perhaps even appropriate way to do
this, but I have done something similar in the past. I change .txt
to .csv and they opened up perfectly in Excel (no pop-up saying I have
a file extension problem). I was wondering if there was some type of
setting in Excel to allow me to do this. I do not eant to open each
file, be prompted, then need to saveas .xls. If there is no way, I
will need to do this manually on all of the files I have. If anyone
has any suggestions, they are certainly welcome.
 
Ad

Advertisements

T

Tyro

That is because a .txt file can be considered to be a .csv file without
comma delimiters The .csv file has comma delimiters between fields. A text
file has spaces or tabs between fields (words). A .txt file could be
considered to be a .csv file with space delimiters between fields. That is
why you're getting way with changing the extension of .txt to .csv. Why
don't you just simply open your .txt files in Excel or import them? You can
still save them as .txt files. Have you considered using Word for your .txt
files? Why are you using Excel for .txt files?

Tyro

Correction. When I referred to .csv files in my response, I meant .txt.

Tyro






- Show quoted text -

I realize this is not the best, or perhaps even appropriate way to do
this, but I have done something similar in the past. I change .txt
to .csv and they opened up perfectly in Excel (no pop-up saying I have
a file extension problem). I was wondering if there was some type of
setting in Excel to allow me to do this. I do not eant to open each
file, be prompted, then need to saveas .xls. If there is no way, I
will need to do this manually on all of the files I have. If anyone
has any suggestions, they are certainly welcome.
 
B

beginner1.mat

Correction. When I referred to .csv files in my response, I meant .txt.

Tyro






- Show quoted text -

Tyro...

I am still having this problem and just found out something
interesting. If I try to open the file in Excel 2002, I do not have
the error message prompt me in the beginning. However, if I use Excel
2007, I have the error message. Do you know why this would occur?
 
T

Tyro

Excel 2007 is checking the file format to see if it conforms to the file
extension. Files with different extensions have different formats. That's
another reason you should not manually change file extensions. Let the
application, Excel in this case, create the file.

Tyro

Correction. When I referred to .csv files in my response, I meant .txt.

Tyro






- Show quoted text -

Tyro...

I am still having this problem and just found out something
interesting. If I try to open the file in Excel 2002, I do not have
the error message prompt me in the beginning. However, if I use Excel
2007, I have the error message. Do you know why this would occur?
 
Ad

Advertisements

Joined
Sep 17, 2009
Messages
1
Reaction score
0
Tyro said:
Excel 2007 is checking the file format to see if it conforms to the file
extension. Files with different extensions have different formats. That's
another reason you should not manually change file extensions. Let the
application, Excel in this case, create the file.

Tyro

wrote in message
news:[email protected]m...
On Jan 26, 8:42 pm, "Tyro" wrote:
> Correction. When I referred to .csv files in my response, I meant .txt.
>
> Tyro
>
> "Tyro" wrote in message
>
> news:[email protected]
>
>
>
> > You should not change file extensions like that. You're asking for
> > trouble. File extensions are used to indicate what type of file the file
> > is and what application created the file. Many applications create files
> > in formats that they understand and that other applications do not
> > understand. .xls files are created by Excel. Excel is also capable of
> > creating .csv files. Other applications can create .csv files too. .csv
> > files are intended to be used to allow easy transfer of data between
> > applications. The format of a .xls file and a .csv file are not the same
> > at all. That is why Excel is giving you the error message and it always
> > will. The proper way is to load your .csv file into Excel or import it
> > into an Excel worksheet and save it as an Excel workbook which will have
> > a
> > .xls extension.

>
> > Tyro

>
> > wrote in message
> >news:[email protected]m...
> >> On Jan 26, 7:26 pm, "Tyro" wrote:
> >>> How did you change a .txt file to be saved with a .xls extension?
> >>> Also,
> >>> the
> >>> error mention you mention does not make sense.

>
> >>> Tyro

>
> >> I changed the names of the extension using the command window (Run =>
> >> cmd). For example, at the c-prompt: "ren file1.txt file1.xls".

>
> >> As for the error message, I retyped it as follows:"

>
> >> The file you are trying to open, 'file1.xls', is in a different format
> >> than specified by the file extension. Verify that the file is not
> >> corrupted and is from a trusted source before opening the file. Do
> >> you want to open the file now?"

>
> >> When I click yes to open the file, the file opens up fine. I just do
> >> not want to do this for the thousands of files that I have and was
> >> wondering if there is a fix or anything I can do. Thanks for the
> >> help.- Hide quoted text -

>
> - Show quoted text -


Tyro...

I am still having this problem and just found out something
interesting. If I try to open the file in Excel 2002, I do not have
the error message prompt me in the beginning. However, if I use Excel
2007, I have the error message. Do you know why this would occur?




hello this is sandeep here....
i had created one excel file using vb.net in xls from but when i try to open it it give error "The file you are trying to open, 'file1.xls', is in a different format
than specified by the file extension. Verify that the file is not
corrupted and is from a trusted source before opening the file. Do
you want to open the file now" if i change it to xlsx then it open properly.
bt i want the same xls format with out error....

do the needfull....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top