Aug 20, 2015 Excel 2016 for Mac supports ODBC data connections with SQL Server and Azure SQL Database right out of the box. This means several great things for anyone who works with external data: When creating or refreshing data connections to SQL Server, there are no third-party drivers required—everything you need is included right in the app. I used to do this with the 'Inspect document' tool, but since I updated to Word 15.14 I haven't been able to do it because I can't find where this tool is. According to Office's support page I should find it in FileInfo.Check for Issues, but when I open the File tab there's nothing called 'Info.'
Problems with Apple’s sandbox requirements in Mac Office 2016 and higher with VBA code
In Windows Excel 97-and higher and in Mac Excel 2011 you can open files or save files where you want in almost every folder on your system without warnings or requests for permission. But in Mac Office 2016 and higher Microsoft have to deal with Apple’s sandbox requirements. When you use VBA in Mac Excel 2016 or higher that Save or Open files you will notice that it is possible that it will ask you permission to access the file or folder (Grant File Access Prompt), this is because of Apple’s sandbox requirements.This means that when you want to save/open files or check if it exists with VBA code the first time you will be prompted to allow access on the first attempt to access such a folder or file.
How to avoid problems
There are a few places on your Mac that you can use to avoid the prompts and let your code do what it needs to do without user interaction. But these folders are not in a place that a user can easily find so below are some steps that I hope to make it easier for you to access the folder manual if you want.
This is the Root folder on my machine that we use in the examples on this page: The folder above you can use to share data between Office programs or with a third party application, so this location will always work if you want to have read and write access. If you want to have a location only for Excel for example use this path : /Users/rondebruin/Library/Containers/com.microsoft.Excel/Data/Users/rondebruin/Library/Group Containers/UBF8T346G9.Office Note: rondebruin is the user name in this path and I agree that the naming of the folder for Office(UBF8T346G9.Office) is not so nice, but Microsoft must use that of Apple. I not use this location on this example page to be sure that every Office program can access my files if this is needed. To get this Excel path you can also use Environ('HOME') or Environ('CFFIXED_USER_HOME') Manual create a folder for your Excel files in the Office folder
This are three ways to easily open the folder manual :
Note : Adding the folder to your Favorites is my favorite because you see the folder in your open and save dialogs in Excel.
Or use this script one time to create a folder for your Office files and create shortcuts to a few important folders, check out this page : Setup your Mac for Mac Office 2016 or higher
How to create a Folder in the Office folder with VBA code
Below you find a macro and a function that you can use to create a folder if it not exists in the Root folder named : UBF8T346G9.Office
In the macro you see one line that call the function and the argument is the name of the folder that you want to create if it not exists. Change 'MyProject' to something else to create another folder.
How do I open files with VBA code in my folder ?
Below you find a macro and a function that you can use to open a file in one of the sub folders of the UBF8T346G9.Office folder. In the macro you see one line that call the function and there are two arguments :
Note : You can also add code in the macro to test if the file is already open, I use that also in the code example in this section : Browse to a file or files in a sub folder of the Office folder.
How do I Save a file with VBA code in my folder ?
The first macro create a file of only the activesheet and save it in a folder named: ProjectName and the second macro save a copy of the file in a folder named Backup. Both are sub folders of your UBF8T346G9.Office folder. Be sure you update your Mac Office install so it is 16.9 or higher.
Note : Both macros use the custum function CreateFolderinMacOffice that you find in the first section of this page.
Browse to a file or files in a sub folder of the Office folder
In the example below it opens a browse dialog with a folder folder named : MyExcelFolder from your UBF8T346G9.Office folderand you are only able to select xlsx files. Below the macro you find a list of format names and you can read how you can change it. Note: Do not forget to copy the bIsBookOpen function in your module, you find it below the macro.
Other file formats :
In the macro you see this code line that say which file format you can select (xlsx).
FileFormat = '{'org.openxmlformats.spreadsheetml.sheet'}'
If you want more then one format you can use this to be able to also select xls files.
FileFormat = '{'org.openxmlformats.spreadsheetml.sheet','com.microsoft.Excel.xls'}'
This is a list of a few formats that you can use :
xls : com.microsoft.Excel.xls
xlsx : org.openxmlformats.spreadsheetml.sheet
xlsm : org.openxmlformats.spreadsheetml.sheet.macroenabled
xlsb : com.microsoft.Excel.sheet.binary.macroenabled
csv : public.comma-separated-values-text
doc : com.microsoft.word.doc
docx : org.openxmlformats.wordprocessingml.document
docm : org.openxmlformats.wordprocessingml.document.macroenabled
ppt : com.microsoft.powerpoint.ppt
pptx : org.openxmlformats.presentationml.presentation
pptm : org.openxmlformats.presentationml.presentation.macroenabled
txt : public.plain-text
More information
See this page for more information about selecting files in Excel 2011 and Excel 2016 and higher
See this page for more information about the file format numbers
FileFormat numbers in Mac Excel
Summary
Program crash or sudden Mac shutting down can cause the unsaved or saved Excel files loss. When the accident happens, do not worry. You can recover the unsaved Excel files on Mac from Temporary or AotuoRecover folder. If you need to recover the permanently deleted or lost Excel files, you can use EaseUS Data Recovery Wizard for Mac to do it effectively.
This page offers 3 reliable methods to help you recover unsaved Excel file on Mac. If you happen to lose unsaved excel file or deleted it by mistake on Mac, stay calm and pick up any method to bring your lost excel file back now:
On the whole, Excel files may get lost due to the program crash, Mac shutting down unexpected, accidental deletion, hard drive formatting, or virus attack. If the Excel files already gone are unsaved, you can use the two solutions in Part 1 to recover them in large part. While if you have mistakenly permanently deleted the Excel files or the saved documents are disappeared caused by other reasons, there is no way but use professional and free data recovery software - EaseUS Data Recovery for Mac recommended in Part 2 to get them back. Read on and see the details.
Part 1. How to Recover Unsaved Excel File on Mac
How many of you have ever met this problem that the Excel is suddenly stuck and fails to respond to Mac? Then you have to follow the instruction to close the program and lose the unsaved file you have been working on for a few hours unsurprisingly. And the unexpected Mac shutting down can also bring the same result. Whatever led the accident, you have a chance to recover Excel file not saved on Mac.
Method 1. Restore Unsaved Excel File from the Temporary Folder
Follow steps provided below to restore unsaved Excel file on Mac from Temporary/Temp folder.
1. Go to 'Applications' > 'Utilities' > 'Terminal'.
2. Type open $TMPDIR and press 'Return' to open the Temporary files folder. Select the folder named 'TemporaryItems'.
3. Find the unsaved Excel file under 'TemporaryItems' and restore.
Method 2. Recover Lost or Unsaved Excel File from AutoSave on Mac
Excel provides you with useful features as AutoSave and AutoRecover to protect file after an accident, like Excel/Mac crash or closure.
About Apple Mac
If the two are enabled, you can probably make unsaved file recovery on Mac in Excel 2016 - 2010. Because the AutoRecovery file has been hidden, you need to make it visible to recover unsaved Excel file.
1. Go to 'Applications' >' Utilities' > 'Terminal'.
2. Type defaults write com.apple.Finder AppleShowAllFiles true into Terminal and hit 'Return' to make all the items visible.
3. Click 'Finder' > press 'Return' on your Mac.
4. Type /Users/username/Library/Containers/com.microsoft.Excel/Data/Library/Preferences/AutoRecovery and click 'Go' to open Excel's AutoRecovery folder.
5. Find the unsaved spreadsheet files. Then recover it to another safe location on Mac.
Part 2. How to Restore Deleted/Lost Excel File on Mac in 3 Steps
You may get the unsaved Excel file back with the above two approaches. But you can't use them to recover lost Excel file from due to accidental deletion, hard drive formatting, system crash, or storage device corruption. Then, what to do at this kind of circumstances? Don't worry. Here comes EaseUS Mac File Recovery Freeware. As a leading data recovery tool, it allows you to do Office document recovery, email recovery, photos recovery, as well as other data recovery.
Now, install it and follow the following tips to restore deleted or lost Excel file on Mac in 3 simple steps.
Step 1. Select the location where your important Excel files were lost and click Scan button.
How To Inspect Excel File Apple Mac 2016 For Meta Data Plan
Step 2. EaseUS Data Recovery Wizard for Mac will start immediately a quick scan as well as a deep scan on your selected disk volume. Meanwhile, the scanning results will be presented in the left pane.
How To Inspect Excel File Apple Mac 2016 For Meta Data Download
Step 3. By Path and Type, you can quickly filter the Excel files you've lost earlier. Select the target files and click Recover Now button to get them back at once.
How To Inspect Excel File Apple Mac 2016 For Metadata Free
After this, you'll get the lost Excel file back and continue your job with the file again. You can also apply this Mac data recovery software to restore deleted photos, music, videos or other data on Mac for free.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |