Free Microsoft Excel 2013
Quick Reference
Free Microsoft 2013 Quick Reference Guide

Free Microsoft Excel 2013 Quick Reference

Different format than specified

Code:
Sub saveeach()
Dim ws As Worksheet, strPath$, New_WB As Workbook

Application.ScreenUpdating = False
strPath = ThisWorkbook.Path & ""

For Each ws In ThisWorkbook.Sheets
    If ws.Name = "namedranges" Then
'donothing
Application.DisplayAlerts = False

Else
    ws.Copy
    Set New_WB = ActiveWorkbook
    With New_WB
        .SaveAs strPath & ws.Name & ".xls"
        .Close
    End With
End If
Next
Application.ScreenUpdating = True
End Sub
I am using this code to take each sheet in a workbook, and save them as and individual XLS file.

The problem i am encountering is when i open one of the save files, i get an error msg.

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

Yes NO Help"

If i open the file, it works fine, however that msg is a pain, does anyone know how to get rid of it?


Post your answer or comment

comments powered by Disqus
After upgrading to Excel 2010, I am getting the following error when try to open an existing
excel document or generating an excel from a web page (.asp page)

The file you are trying to open <filename.xls> is in a different format than specified by the file extension. verify the file is not corrupted and is from trusted source before opening the file. Do you want to open the file now?

This errors particularly occurs when I am trying to open an XLS file (Excel 2000-2003) with Excel 2010.

Is there any alternative way to fix this problem other than changing the registry ([HKEY_CURRENT_USERSoftwareMicrosoftOffice14.0ExcelSecurity]
“ExtensionHardening”=dword:00000000) or using thrid party tools.

Thanks
Jambai

Hi,

Apparently my program quits after i try to open an excel file. If you open the file manually you get an error upon opening the file...something like this:

"File you are tyring to open is in a different format than specified by the file extension".

The problem is i am using an excel macro using VBA and once the file is opened the VBA execution quits.

The excel file turns out to be an xml file which excel can open the file and have the VBA continue running if i RENAME the file with an "xlsx" extension. The problem is that i cant ask the user to rename the file.........how do i get VBA to open the file without an issue?

Hello. I an IBM iSeries developer and we are creating .xls files that are emailed to the users. When the user tries to open the file, they get a message stating that the file format is different than the .xls extension. I realize that this is possible, and the users just click the "Yes" button to open the document with no problem.

I've heard that there is a setting within Excel that will bypass the display of the warning. Is this true? If so, I would sure like to know where it can be found.

Thanks!
Chris

Hi all,

I have a workbook where I'm archiving off a single worksheet from the rest of the book. I want to save that sheet as a new file with '-Closed" after the sheet's name and then delete the sheet from the original workbook with out having a confirm msgbox popup for the save. I could not remember how to turn off the one for the delete box, if anyone could toss that ou it would be a bonus.

The main issue I'm running into is that I'm having a bit of trouble with this code and I'm not sure why:

...
'Open Dialog box with file name filled in from wsName
FullFileName = Application.GetSaveAsFilename(wsName & "-Closed.xls", "Excel files (*.xl*),*.xl*", 1, "Save File For Archive")

'save sheet
ActiveWorkbook.SaveAs FullFileName
If SaveAsUI Then SaveAsUI = False
'close new book
ActiveWorkbook.Close
'delete sheet in original book
Sheets(wsName).Select
ActiveWindow.SelectedSheets.Delete
...

When I run the macro it seems to save fine, but when I double click on the saved file to open it I get a msgbox with this:

"The file you are trying to open 'filename-Closed.xls', is in a different format than specified by yhe file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you wnat to open the file now?" - [yes] [no] [help]

When I open it, it looks ok. But I'm going to have non-excel people using this... how can I get rid of the msgbox so they don't freek out on me?

Is there a better way of doing this? (I'm sure there is... but I'm just a hack at this stuff)

Thanks for your help,
Steve

Dear All,

When i mannually open a PRN file in excel. I only have a message saying "The file you are trying to open is in 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?" [Yes] [No] [Help]
I select Yes and the date shows OK.

I simplified my VBA a lot. Here is the line below : simple no :-)


	VB:
	
 GetPRN() 
    Workbooks.Open Filename:="F:EXPORT.prn" 
    Columns("D:D").EntireColumn.AutoFit 
End Sub 

If you like these VB formatting tags please consider sponsoring the author in support of injured Royal Marines
On some lines, the date is store in "40973" and sometime directly in "22/05/2012". I looked at the original PRN and all dates are in "dd-mm-yy" format...

If necessary i could send you the PRN file to test in real.

Thanks for your help.

I have a macro which copies a sheet to a new workbook and then saves the workbook and attaches it to an e-mail.

When I open the attachment in the e-mail, it shows the following error:

"the file that you are trying to open 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 is fine. However, when the email is sent to customers, the error scares them a bit and a lot of them do not wish to open the file.

My code is as follows:

    Dim FileExtStr As String
    Dim FileFormatNum As Long
    Dim Sourcewb As Workbook
    Dim Destwb As Workbook
    Dim TempFilePath As String
    Dim TempFileName As String
    Dim OutApp As Object
    Dim OutMail As Object

    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With

    Set Sourcewb = ActiveWorkbook
    
    Sheets("Custom").Copy
    
    Set Destwb = ActiveWorkbook


With Destwb
FileExtStr = ".xls"
End With

' 'Change all cells in the worksheet to values if you want
With Destwb.Sheets(1).UsedRange
.Cells.Copy
.Cells.PasteSpecial xlPasteValues
.Cells(1).Select
End With
Application.CutCopyMode = False

'Save the new workbook/Mail it/Delete it
TempFilePath = Environ$("temp") & ""
TempFileName = "Confirmation Letter - Ref " & Ref & ""

 Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.LogOn
    Set OutMail = OutApp.CreateItem(0)
    
With Destwb
.SaveAs TempFilePath & TempFileName & FileExtStr

With OutMail

' Compose the message
Msg = EmailBody

            .To = "" & Email_To & ""
            .CC = ""
            .BCC = ""
            .Subject = "" & Email_Subject & ""
            .Body = Msg
            .Attachments.Add Destwb.FullName
            If Attachment1 = "" Then
            ' Do Nothing
            Else
            .Attachments.Add "c:HBPOSLetters" & Attachment1.Value
            End If
            If Attachment2 = "" Then
            ' Do Nothing
            Else
            .Attachments.Add "c:HBPOSLetters" & Attachment2.Value
            End If
            If Attachment3 = "" Then
            ' Do Nothing
            Else
            .Attachments.Add "c:HBPOSLetters" & Attachment3.Value
            End If
            If Attachment4 = "" Then
            ' Do Nothing
            Else
            .Attachments.Add "c:HBPOSLetters" & Attachment4.Value
            End If
            If Attachment5 = "" Then
            ' Do Nothing
            Else
            .Attachments.Add "c:HBPOSLetters" & Attachment5.Value
            End If
            If Attachment6 = "" Then
            ' Do Nothing
            Else
            .Attachments.Add "c:HBPOSLetters" & Attachment6.Value
            End If
            .Send
        End With
.Close SaveChanges:=False
End With

'Delete the file you have send
Kill TempFilePath & TempFileName & FileExtStr
Thanks in advance

Hi, I have a lot of .XLS files that are created by SAP.
I'm trying to combine all the files into 1 file (automaticly without opening each file in excel). I found an xls file online with a macro that does that, but unfortunately it works only with .xls files, and my files aren't real xls I guess cuz when I open them I get a msg "the file u r trying to open (name) is in a different format than specified by the file extension, verify...".
so the macro gives me error with those files "run time error 1004, method Range of object '_Worksheet' failed.
is there a macro that changes file's format that I can add to the macro I already found? (fyi, I don't know anything about macros)

I'm looking for any suggestion that might solve this issue, may it be another way to combine files or whatever, I'm kinda stressed out and on a very tight schedule so any advise is appreciated!!

Hi All,

I've asked the below quesion in another post but I didn't get solution. Let
me try one more time.

I'm using a Macro which will open a template with predefined formulas and
copies selected sheet data into template. After coping, template will be
calculated with copied data after this template will save as Output.xls and
closes the saved file. By this macro functionality is completed.

Here is the sample code:
set wbkTemplate=workbook.open("C:Template.xls",false)
Copying input sheet data into 'RawData' of wbkTemplate.

wbkTemplate.SaveAs "C:Output.xls"
wbkTemplate.close
set wbkTemplate=Nothing

While opening output.xls I'm getting following error:
The file you are trying to open, 'Output.xls', is in a different format than
specified by the files extension. Verify that the file is not corrupted and
is from trusted source before opening the file. Do you want to open the file
now?

On clicking 'Yes' Output.xls is opening machine language.

We observed this above error while running macro at excel 2007. Origionally
the macro is developed and tested at excel 2003 without issue.

Please helpme out on resolving above said issue by sharing your thoughts and
ideas which will be appreciated.

Advanced Thanks
Vins

I am getting the below warning when I try to open the excel file in MS 2007.
The same file opens in 2003 without any warning.

""The file you are trying to open, 'servlet.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?"

Below is the content of my servlet.xls file:

servlet

Arial Italic

I am getting the below warning when I try to open the excel file in MS 2007.
The same file opens in 2003 without any warning.

""The file you are trying to open, 'servlet.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?"

Below is the content of my servlet.xls file:

servlet

Arial Italic

Could somebody please let me know how can I avoid the warning when I open
the above excel in the MS Office 2007.

Should I need to add any MIME type in the above excel to avoid the warning.

Thanks In Advance,
Vidya

I have the 2007 home/student version, that operates with Microsoft Vista.
Every morning before I open the file (and its been two weeks since I've
backed it up)...I change the date on the file...so today I made it "SA Client
Outreach 10.10.07"...

When I opened up the file, it said this: The file you are trying to open,
'SA Client Outreach 10.10.07.xls', is in a different format than specified by
the file extension. Verify that the file is not corrupted and is from a
trust source before opening the file. Do you want to open the file now?

It then gives me the option of saying "Yes, no, or help." If I click yes,
it opens the file but its blank. The file itself was massive, but it now
says that it is 0 bites.

I have no idea how to recover the file, or what happened to it. Its as if
it just vanished into thin air.

Do you have any idea what I should do, or where it might have gone? Any
assistance you might be able to give I would really appreciate.

Hi,

I have a large; and to me, very valuable personal.xls created with Excel 2003.
Since installing E2007 whenever I open Excel 2007 I get the message

"The file you are trying to open, PERSONAL.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?"

Click OK and my personal.xls opens and works fine

This is only an irritation but is there something I should do to make P.XLS
compatible with E2007 and at the same time enable me to keep on using it with
E2003 which i still have installed?

Mike

I have created a file with my Mac computer with extensive formatting that I don't want to lose, but I can't open it on a windows PC. If it does open the text is all jumbled and it is in wingdings or something of that sort. Most of the file is text stored in specific columns.

The error note we receive is: The file you are trying to open < > is in a different format than specified by the file extention. 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? ... This is when we get a wingding and unformatted jumble (when we select yes)

We have saved it on the mac in a .xlsx format and also a .csv, however the csv causes us to lose our formatting.

Please advise
Thanks...

Hi,

I have Office 2007 Standard installed on my computer and I get the following error every time I start Excel:

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

I click on yes and have no apparent problems with the program. A search of my hard drive shows no files with this name. Googling this file shows just a few hits in asian languages.

Does anybody know how to get rid of this annoying, albeit not a show stopping, popup?

Cheers,

Dog

Hi Guys,

Have a name.xlm file that was likely created in office 2000. I'm running excel 2007, but when I click on the file I get the error "the file you are trying to open name.XLM is in a different format than specified by the file extension... yada yada... do you want to open the file now?" yes/no/cancel.

I click yes but nothing happens, excel stays blank, doesn't even open a blank worksheet - the program isn't freezing or anything. Removing the error (via regedit as specified by the microsoft tech support) didn't help. I can't edit the XLM file itself as I'm one of only a few running office 2007, it's a common file and most of the users here have office 2000. When I had office 2000 it was no problem to open.

Any ideas? thanks in advance.

The other day, someone sent me a spreadsheet with multiple worksheets. I needed to be able to send each worksheet to an individual for review, and each recipient did not need to see everyone else's sheet. So I found a tip on-line that included the following VBA code to save the sheets to separate Excel files. Life was good until those who didn't have Office 2007 could not open their sheets, even though the original file had been saved with the Excel 97-2003 option. They had first received the message, "The file you are trying to open, "<filename>" 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 they said yes, all they saw was a scramble of machine code. I thought that maybe there was a special extension for Excel 97-2003 files, but when I looked it up in a book I have, it just said the extension was .xls, which is what the code used. Is there other formating that needed to be saved? Any help would be appreciated. Here's the code.

Sub Copy_Sheets_to_Separate_Workbooks()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
If ws.Visible = True Then
ws.Activate
ActiveSheet.Copy
With ActiveWorkbook
.SaveAs "C:Documents and Settingsbruce.vanbibberMy DocumentsTITLE I - M A I NTitle I BudgetsAllocation Budgets - Schoolwide - FY 10" & _
InputBox("Please enter the Save As Name...", "Worksheet Save As") & ".xls"
.Close
End With
End If
Next ws
End Sub


Hello. My boss recently deleted a large amount of files created in Excel 2010. I recovered (undeleted) the files, but when he attempts to open them the following error pops up: The file you are trying to open 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 this file.

Any ideas?

Thanks in advance

Hi Guy's I'm having an issue in where I have developed a Macro which on the event of a button press which will generate an email and convert the Spreadsheet which was being worked on into a csv file.

Now, this works great in Excel 2007, I press the button and I receive the email and in the attachment is a csv file which I open and everything works great. Now when I have tested this on an Excel 2003 machine. The email comes through fine and the attachment is a csv one, but when I come to open it, I get the message, 'The file you are trying to open, '12345654321.csv', 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 file. Do you want to open the file now?'

On clicking yes, it opens the spreadsheet in an excel format???????

Here is my code, any help would be much appreciated.

Sub Mail_ActiveSheet()
'Working in 97-2007
    Dim FileExtStr As String
    Dim FileFormatNum As Long
    Dim Sourcewb As Workbook
    Dim Destwb As Workbook
    Dim TempFilePath As String
    Dim TempFileName As String

    With Application
        .ScreenUpdating = False
        .EnableEvents = False
    End With

    Set Sourcewb = ActiveWorkbook

    'Copy the sheet to a new workbook
    ActiveSheet.Copy
    Set Destwb = ActiveWorkbook

    'Determine the Excel version and file extension/format
    With Destwb
        If Val(Application.Version) < 12 Then
            'You use Excel 97-2003
            FileExtStr = ".csv": FileFormatNum = -4143
        Else
            'You use Excel 2007
            'We exit the sub when your answer is NO in the security dialog that you only
            'see  when you copy a sheet from a xlsm file with macro's disabled.
            If Sourcewb.Name = .Name Then
                With Application
                    .ScreenUpdating = True
                    .EnableEvents = True
                End With
                MsgBox "Your answer is NO in the security dialog"
                Exit Sub
            Else
                Select Case Sourcewb.FileFormat
                Case 51: FileExtStr = ".xlsx": FileFormatNum = 51
                Case 52:
                    If .HasVBProject Then
                        FileExtStr = ".xlsm": FileFormatNum = 52
                    Else
                        FileExtStr = ".xlsx": FileFormatNum = 51
                    End If
                Case 56: FileExtStr = ".csv": FileFormatNum = 6
                Case Else: FileExtStr = ".xlsb": FileFormatNum = 50
                End Select
            End If
        End If
    End With

    '    'Change all cells in the worksheet to values if you want
    '    With Destwb.Sheets(1).UsedRange
    '        .Cells.Copy
    '        .Cells.PasteSpecial xlPasteValues
    '        .Cells(1).Select
    '    End With
    '    Application.CutCopyMode = False

    'Save the new workbook/Mail it/Delete it
    TempFilePath = Environ$("temp") & ""
    TempFileName = Sourcewb.Sheets("Sheet1").Cells(2, 1).Value & Format(Now, "yyyymmddhhmmss")

    With Destwb
        .SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
        On Error Resume Next
        .SendMail "joebloggs@hextex.com", _
                  "Thank you for the order"
        On Error GoTo 0
        .Close savechanges:=False
    End With

    'Delete the file you have send
    Kill TempFilePath & TempFileName & FileExtStr

    With Application
        .ScreenUpdating = True
        .EnableEvents = True
    End With
End Sub
Thank You

Jonah

I’m getting an intermittent Excel 2007 “changes could not be saved” error under Win 7 that did not occur under Vista.

I’m working in a macro-enabled file that I use every day. It has about 15 tabs. Sometimes when I save the file, I get the following message requiring me to follow the sequence shown here:

1. “Your changes could not be saved to ‘filenam.xlsm’ because of a sharing violation. Try saving to a different file.” Only one Excel file is open and I respond with okay which is my only choice.

2. Then I get the message “The file your are trying to open, ‘65E6A400’, 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?” I respond with no.

3. Then I get the message “Your changes could not be saved to ‘filename.xlsm’, but were saved to a temporary document named ‘65E6A400’. Close the existing document, then open the temporary document and save it under a new name” I respond with okay which is my only choice.

4. Then I close the file and close Excel

5. Then I re-open filename.xlsm (the original file) and it sometimes appears to have all of the recent changes but sometimes it doesn’t. Sometimes the original file does not have all of the changes and I have to delete the original file and open the file ‘65E6A400’ and re-save it with the original filename.

I’ve been using this file for several years and I never had a problem under Vista (Excel 2007) or XP (Excel 2003). Can you please help me resolve this problem?

Thanks,

Don Krafft

Hello,

Using
 I can open an .xlt file, however what I'd like to do is instanciate the .xlt, i.e. open it as an .xls in the template
format.

The current dynamic of my project is: Sheet A opens TEMPLATE.xlt, performs some operations inside TEMPLATE.xlt and calls a save routine inside TEMPLATE.xlt, saving it as an .xls.

When opening the saved files an annoying nag appears...

"The file you are trying to open is in a different format than specified by the file extension..." Any assistance much appreciated!

i can't open all my excel file that i copy from my previous computer. A window pop up and show "the file you are trying to open ".." 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".

What happen to the file. Is it corrupted. It happen to all my important excel file only. Is that anyway that i can open it?

Anyone please help me out. Thanks.

Hi,

I have created a macro to create a new workbook which saves in the same folder of the macro file.

But when I reopen the "New workbook" file I am getting the below message relating to the file extension, trusted source.

"The File you are trying to open, "New Workbook", 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?"

Please help to rectify the above message while opening the newly created workbook.

Regards,
Vijay

Hi All,

Can any one help me solve this.. I have tried to search for this on the net for four days but was not able to get any help....

My problem is that I have a macro in my excel file (xlsm) that opens an external internet site which helps me to open a xls file that is linked on the excel file. For your easy understanding I have pasted a code that fetches the xls file from my webpage:

This code opens webpage http://www.xyz.com and waits for the page to load. Once the page loads it will go a specific link on
the page which will open the xls file. But before I get to see the xls file or the content I get an alert.

Now the problem: The code can easily open the xls file linked on the webpage. But I get a pop-up alert with the following message:

The file you are trying to open, "7F00000001465446545.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?
And it has three button, YES, NO and HELP.

1. Is there a way that I can bypass this message or click on the yes button?
2. Also the file name that is generated by the site is random it changes every time we run the macro.Is there a way that we can activate the newly opened file and copy specific columns. This copied columns are further pasted on our original excel file (xlsm)?

Any help to resolve this is appreciated.

Regards,

Abz

I'm running Excel 2007 on a WinXP (SP2) machine (dual core, 4GB RAM, 8GB free HDD space).

I keep getting a strange error message frequently when I try to save large files (> 2MB) with lots of sheets. Excel seems to save okay (the save progress bar at the bottom finishes), but then a dialog box pops up saying:
Your change could not be saved to filename.xls because of a sharing violation. Trying saving to a different file. Once I hit Ok on that dialog box, it immediately gives another dialog:
The file you are trying to open, '56C2F10', 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? Y/N I hit Yes, and it then opens another version of the same file and gives me the Save As... dialog box. Once I enter a different name, it saves that file and closes it, leaving me with the original file that I was trying to save (but could not). I then close that original file and open the new/renamed file and it contains all my changes.

As I mentioned, this happens usually with large files (>2MB), usually ones which have many sheets (>10). It has happened with .xls, .xlsx, and .xlsm formats. I am saving only to my local hard drive, and the file is not shared with/on any other user/server/machine.

It is very annoying, since I have to interrupt my work to close the "corrupted" file and open the newly renamed one, not to mention that I end up with multiple copies of the files.

Any insight as to what's causing this problem, and how to fix it?


No luck finding an answer? You could always try Google.