xla vs xlam addin, what is the difference? - excel

Could someone please explain the difference between an xla Excel addin format and an xlam Excel addin format? Googling didnt provide anything useful.

The m stands for macro-enabled which is the new format (as from Excel 2007).
These are add-ins that may call macro's.
On the other hand, you could also have xlax extensions, which are meant for macro-freeworkbooks.
Note also the difference between xls and xlsm, where xlsx files also don't contain macro's.
Why? My guess is that the main reason would be security.
Some people don't like to receive files, not knowing if there are potentially harmful macro's in it. In the old format, you could not make the distinction based on the file extension.

Both files are macro enabled files:
XLA files are excel files for office 97 - that are loaded as addins
XLAM files are excel 2003+ files, which are actually zip files that have xml documents inside them per opendocument protocol.

Related

Saving standard XLSM Excel with Macros as XLSB (Excel binary)

I have a large project with Excel VBA files. Planning on moving from the xlsm file format to the xlsb (Excel binary). When I save the xlsm file as an xlsb I get warning.
It displays "abc.xlsm contains features that this version of Microsoft Excel can't save in another file format. Do you want to continue saving in this format and remove these features?"
Didn't know that xlsm can contain stuff that xlsb can't. Would be curious to know what exactly that is.
Anybody got an idea what the problem could be?

EPPlus Adding VBA Code Corrupts resulting xlsx file

I'm creating an excel file using EPPlus from a datatable and saving it to a file, all fairly standard. This works without any hassles. However, if I create a vba project, and add any vba code, the resulting .xlsx file is suddenly corrupted. When try and open it with 2013, you get the standard error.
"Excel cannot open the file 'xyz.xlsx' because the file format or file
extension is not valid. Verify that the file extension matches the
format of the file.
If I change the extension to .xls, the file opens ok, and the script runs fine. I'm on the latest beta of Epplus (4.5.0.1). Should I just change the file extension and stick to .xls, or is there something amiss?
ExcelPackage.Workbook.CreateVBAProject()
ExcelPackage.Workbook.CodeModule.Code = "'Script is here"
Dim FInfo as new FileInfo("C:\Myfiles\ThisFile.xlsx")
ExcelPackage.SaveAs(FInfo)
You can not add VBA code to XLSX file format.
Take a look at here
.xlsx:
The default XML-based file format for Excel 2007-2013. Cannot store
Microsoft Visual Basic for Applications (VBA) macro code or Microsoft
Office Excel 4.0 macro sheets (.xlm).
Also take a look at here
to see differences between different formats:
XLSM If you include VBA macros in your XLSX file, you will be asked to
change the file extension to XLSM. Only that way you can save your
macro within the Excel file (there are other file types possible, e.g.
XLSB – but you can’t use XLSX for VBA macros)
Save your file as XLSM and it should work.

Excel automation: Get a reasonable file format/extension for saving

In our Delphi app we automate MS Excel 2007 to generate and save a xls/xlsx file. How should we go about choosing a file format and extension for the generated file?
Hardcoding some values (e.g. xlOpenXMLWorkbook and .xlsx) doesn't work if the user has an older version of Excel installed. Not specifying a format probably works for older versions too (we're checking this right now) but leaves the question what the correct extension is. E.g. using .xls under Excel 2007 results in a XLSX file with wrong extension which leads to complaints when you open it in Excel.
omit extension AND format:
activeworkbook.SaveAs "fred"
will save the file as the appropriate type, and supply the extension too. The file will be fred.xlsx in 2007+ and fred.xls in previous versions.

Excel file and program structure

I need to know for a school project how Excel work. Precisely I need to know what kind of structure is behind an Excel file and how the Excel program work with this file.
I know Excel is a Microsoft propriety and it' s not Open Source so I know I can' t find too much on this argument... But everything that can help me to understand how excel work it' s useful.
If I could not find something about Excel I will try to take a look at Open Office or Open Document format. So even some information about this will be real useful.
Thanks to all
You can find details of the MS Office BIFF file formats here in the microsoft.com library, while the Office Open XML format is published here on the ECMA site and here in the microsoft.com library.
You can find specifications for the OpenDocument format used by Open Office on the OASIS site
It is simpler than you may think.
An excel file is just a zip file of multiple XML documents. Each XML document corresponds to one spreadsheet in the Excel file.
You will find the XML sheets at xl\worksheets inside the zip folder.
You can scripting reading and writing to it.

Identifying Different Excel File Formats

Is anyone familiar with a library or tool that can determine which format an excel file is in? Or, failing that, documentation on the different formats that would allow me to write my own?
The Excel file format is called the Binary Interchange File Format (BIFF) there are different versions of Excel that use the same version of BIFF.
Open Office document on the Excel File Format.
Take a look at the Open Office API, this should help you.
Excel 97-2003 workbooks are known as Biff8. They are actually OLE Compound documents which are essentially a file system within a file. They store the main workbook in a stream named "Workbook" and they have other streams for VBA modules, OLE objects, document properties, etc...
Win32 includes APIs for reading OLE Compound Documents. They are far from trivial. Once you get the "Workbook" stream, the first Biff record identifies the file as being an Excel file.
You can find excellent documentation from Microsoft on the Biff8 file format on the Microsoft Office Binary File Formats page.
The new Excel 2007 Open XML (xlsx) format is actually a zip file with workbook parts and is documented at OpenXmlDeveloper.org.
I am not aware of a tool which will simply tell you the format of a workbook. You could take the easy, but not very reliable approach of just looking at the extension which will be right 99%+ of the time - if accuracy is not an issue.
There are many tools to read xls and xlsx workbooks, including SpreadsheetGear for .NET which reads both.
Disclaimer: I own SpreadsheetGear LLC

Resources