Excel Template Extensions

File formats that are supported in Excel In Excel 2010, you can use other formats such as PDF and XPS. Read an article or try Office 365! You can save a Microsoft. Make better decisions with ‘Decision Making Tool’: an Excel based quantitative scoring template. Includes extentions browsable by application, operating system or ranking.

File Extensions In VBA. File Extensions And Their Implications In VBA Coding.

Microsoft Excel is a spreadsheet developed by Microsoft for Windows, Mac OS X, and iOS. It features calculation, graphing tools, pivot tables, and a macro programming.

This page describes how the Windows Hide File Extensions setting affects code in Excel. A file extension is a three or four character code, preceded by a period, that follows the proper name of a file.

For example, the extension of a file named. Book. 1. xls is xls. Windows uses the file extension to determine what program is to be used to open a file. The System Registry, a database. Windows, contains an entry for the xls extension that specifies that Excel is to be used to open the file. It is. by the use of the extension that Windows knows to launch Excel, rather than, say, Word, to open an xls file. If you delete or change the.

Windows can no longer determine the appropriate program to launch when opening the file. This can render a file unusable if the user. Because of this potential problem and perceived loss of data, Windows by default hides.

Excel Template Extensions

Explorer windows. For example, the name of the file Book. Book. 1, without. The hide extensions setting can be changed from the Folder Options dialog box available from any Windows Explorer window. The options dialog is shown. It is worth noting that enabling the hide extensions setting to hide file extensions can make you more vulnerable to virus or trojan horse files. This is due to the.

The list of file extensions associated with Microsoft Excel, download, screenshot, icons, review and additional related information.

Windows. A virus writer may name a file Some. Name. jpg. exe. If the hide extensions setting. Some. Name. jpg is displayed in Explorer windows. Most. users know that jpg files are innocuous and, seeing the jpg extension, assume that Some. File. jpg. is a harmless image file. When the user clicks on the file to open it, Windows sees the exe extension and executes the program, unleashing potential destruction.

The hide extensions setting affects Excel and VBA code in two ways. First, it affects how you can refer to workbooks in the Workbooks.

Excel Template Extensions

Second, it affects how you can use the Caption property of a Window in a call to the Find. Window. Ex API. If the hide extensions setting is not in effect (meaning that extensions are indeed displayed in Windows), you must include the xls extension. Workbooks collection. For example, if you have open a workbook named. Book. 1. xls, you must use. Workbooks("Book. 1. Activate. Workbooks("Book.

Activate. to refer to the Book. The second line of code above, without the xls extension, will fail. Subscript Out Of Range, because there is no workbook with the name Book. If the hide extensions. Workbooks("Book. 1"). Activate. Workbooks("Book.

Activate. These lines of code assume that you do not have open both an unsaved workbook with the name Book. Book. 1. xls. With the hide extensions setting enabled (so that extensions are hidden in Windows), the two lines of code. As a matter of good programming practice, you should always include the xls extension in a workbook.

This ensures that you reference the correct workbook regardless of the value of the hide extensions property. The second effect of the hide extensions setting is more subtle and can be much harder to debug if you don't know what to look for. Advanced level. programming in Excel often makes use of the Windows Application Programmatic Interface (API) function libraries, and one of the more common API functions is. Find. Window. Ex function.

This is used to find the window handle (HWnd) of a window, using the caption of the window as an identifier. The Caption property of a Window object returns the workbook name including the xls extension. Windows. For example, the Caption returns Book.

Book. 1, even if extensions are hidden and do not appear in the title bar of the window. This is done, I assume, to allow Excel to have. Book. 1, a saved Book. Book. 1. xlt template file and.

Book. 1. csv CSV file. The string passed to the Find. Window. Ex function as a window text value requires that the file extension be removed if the. Windows hide extensions setting is enabled. For example, if the hide extensions setting is enabled so that extensions are not displayed, a. Find. Window. Ex using the window text Book.

No Window Found value. You must. strip the xls extension from the Caption before passing it to Find.

Window. Ex function. The current value of the Windows hide extensions setting is stored in the System Registry, in the named value Hide. File. Ext under the. HKEY_CURRENT_USER\Software\Microsoft\Windows\Current.

Version\Explorer\Advanced. The code described on this page and available in downloadable module file includes a function named. Does. Windows. Hide. File. Extensions that reads the registry value and returns TRUE if the hide extensions setting is enabled (extensions. FALSE if the hide extensions setting is disabled (extensions are visible). The declaration of the Does.

Windows. Hide. File. Extensions is as follows. Function Does. Windows. Hide. File. Extensions() As Boolean. The function takes no input parameters and returns simply TRUE or FALSE. The module file also contains a function named Window.

Caption that returns the. Caption of an Excel. Window object, with the xls extension removed if required. The function declaration is.

Function Window. Caption(W As Excel. Window) As String.

The parameter W is a reference to an Excel. Window object, and the function returns the Caption. Window with the extension removed if necessary.

The module also contains a function named Window. HWnd that returns the handle of specified window. That function's declaration is. Function Window. HWnd(W As Excel. Window) As Long. where W is a reference to an Excel. Window object. The result of the function is the HWnd of the Window or 0.

The Window. HWnd function will work correctly regardless of the value of the hide extensions setting. You can download the mod.

Window. Caption module here. The complete code is shown below. This page last updated: 1. March- 2. 00. 8. Option Explicit. Option Compare Text.

Private Declare Function Find. Window. Ex Lib "user. Alias "Find. Window. Ex. A" ( _. By. Val h. Wnd. 1 As Long, _. By. Val h. Wnd. 2 As Long, _.

By. Val lpsz. 1 As String, _. By. Val lpsz. 2 As String) As Long. Private Declare Function Get. Window. Text Lib "user.

Alias "Get. Window. Text. A" ( _. By. Val HWnd As Long, _.

By. Val lp. String As String, _. By. Val cch As Long) As Long. Private Declare Function Reg. Open. Key. Ex Lib "advapi. Alias "Reg. Open. Key. Ex. A" ( _. By.

Val HKey As Long, _. By. Val lp. Sub. Key As String, _. By. Val ul. Options As Long, _. By. Val sam. Desired As Long, _. Result As Long) As Long. Private Declare Function Reg. Query. Value. Ex Lib "advapi.

Alias "Reg. Query. Value. Ex. A" ( _. By. Val HKey As Long, _. By. Val lp. Value. Name As String, _.

By. Val lp. Reserved As Long, _. LPType As Long, _. LPData As Any, _. Data As Long) As Long. Private Declare Function Reg. Close. Key Lib "advapi.

By. Val HKey As Long) As Long. Private Declare Function Get.

Class. Name Lib "user. Alias "Get. Class. Name. A" ( _. By. Val HWnd As Long, _. By. Val lp. Class. Name As String, _. By. Val n. Max. Count As Long) As Long.

Private Const HKEY_CURRENT_USER As Long = & H8. Private Const HKEY_LOCAL_MACHINE As Long = & H8. Private Const HKEY_CLASSES_ROOT As Long = & H8.

Private Const HKEY_CURRENT_CONFIG As Long = & H8. Private Const HKEY_DYN_DATA As Long = & H8.

Private Const HKEY_PERFORMANCE_DATA As Long = & H8. Private Const HKEY_USERS As Long = & H8. Private Const KEY_ALL_ACCESS As Long = & H3. F. Private Const ERROR_SUCCESS As Long = 0&. Private Const HKCU As Long = HKEY_CURRENT_USER.

Private Const HKLM As Long = HKEY_LOCAL_MACHINE. Private Enum REG_DATA_TYPE. REG_DATA_TYPE_DEFAULT = 0. REG_INVALID = - 1. REG_SZ = 1. REG_DWORD = 4. Private Const C_EXCEL_APP_CLASSNAME = "XLMain".

Private Const C_EXCEL_DESK_CLASSNAME = "XLDesk". Private Const C_EXCEL_WINDOW_CLASSNAME = "EXCEL7". Function Does. Windows. Hide. File. Extensions() As Boolean. Dim Res As Long. Dim Reg.

Key As Long. Const KEY_NAME = "Software\Microsoft\Windows\Current. Version\Explorer\Advanced". Const VALUE_NAME = "Hide. File. Ext". Res = Reg.

Open. Key. Ex(HKey: =HKCU, _. Sub. Key: =KEY_NAME, _. Options: =0& , _. Desired: =KEY_ALL_ACCESS, _. Result: =Reg. Key). If Res < > ERROR_SUCCESS Then.

Exit Function. Res = Reg. Query. Value. Ex(HKey: =Reg. Key, _. lp. Value. Name: =VALUE_NAME, _. Reserved: =0& , _.

LPType: =REG_DWORD, _. LPData: =V, _. lpcb. Data: =Len(V)). If Res < > ERROR_SUCCESS Then. Reg. Close. Key Reg.

Key. Exit Function. Reg. Close. Key Reg. Key. Does. Windows. Hide. File. Extensions = (V < > 0).

Function Window. Caption(W As Excel. Window) As String. Dim Hide. Ext As Boolean.

Dim Cap As String. Dim Pos As Long. Hide. Ext = Does. Windows.

Hide. File. Extensions(). Cap = W. Caption.

If Hide. Ext = True Then. Pos = In. Str. Rev(Cap, "."). If Pos > 0 Then. Cap = Left(Cap, Pos - 1).

Window. Caption = Cap. Function Window. HWnd(W As Excel. Window) As Long. Dim App. HWnd As Long. Dim Desk. HWnd As Long. Dim WHWnd As Long.

Dim Cap As String. App. HWnd = Application. HWnd. Desk. HWnd = Find.

Window. Ex(App. HWnd, 0& , C_EXCEL_DESK_CLASSNAME, vb. Null. String). If Desk. HWnd > 0 Then. Cap = Window. Caption(W). WHWnd = Find. Window.

Ex(Desk. HWnd, 0& , C_EXCEL_WINDOW_CLASSNAME, Cap). Window. HWnd = WHWnd. Function Window. Text(HWnd As Long) As String. Dim S As String. Dim N As Long. S = String$(N, vb. Null. Char). N = Get.

Window. Text(HWnd, S, N). If N > 0 Then. Window. Text = Left(S, N).

Window. Text = vb. Null. String. Function Window. Class. Name(HWnd As Long) As String. Dim S As String. Dim N As Long. S = String$(N, vb.

Null. Char). N = Get. Class. Name(HWnd, S, N).

If N > 0 Then. Window. Class. Name = Left(S, N). Window. Class. Name = vb.