SECTION 5: Finalizing Your Workbook In this section you will learn how to: Protect a workbook Protect a sheet Protect Excel files Unlock cells Use the document inspector Use the compatibility checker Mark a workbook as final Insert Excel data into Word Modify Excel data after insertion Link Excel data in word Link an Excel chart in Word Link an Excel workbook to an Access database Import table, PivotTable, and PivotChart data from Access Transform an Excel workbook into an Access database Use Outlook to send an Excel worksheet Publish a workbook as a PDF file Fax an Excel workbook Open Excel data in different formats Import data from a text file Import data from an external data source
Lesson 5.1: Protecting your Workbook The information in your Excel workbooks can be very important. One possibility is that your workbooks contain sensitive and confidential data that should only be seen by authorized users. Another possibility is that your workbooks contain crucial data that must not be modified or altered in any way, intentionally or otherwise. Perhaps your information is such that you must keep it private, and secure. Fortunately, Excel 2007 provides mechanisms for protecting and securing your workbooks. In this lesson, you will learn how to protect the structure of your workbook and you will learn how to protect your workbook from unauthorized users. In addition, you will learn how to protect the data in your workbook on a sheet by sheet basis. Protecting your Workbook There are two basic forms of protection that you can apply to your Excel 2007 workbook. First, you can protect the structure of your workbook, and second, you can protect the windows in your workbook. If you protect the structure of your workbook, users will not be able to add, delete, or move any of the worksheets in your workbook. The arrangement of the worksheets will be fixed as long as the structure is protected. If you protect your workbook windows, the sizes and positions of any windows in your workbook will be preserved so that every time you open the workbook, the window layout will be the same. To apply these types of protection to your workbook, click the Protect Workbook button on the Review Ribbon and choose the type of protection that you want.
If you click Protect Structure and Windows, you will see the related dialogue. If you put a check mark in the Structure check box and click the OK button, the workbook structure will be protected. This means that users will not be able to remove, add, or change the order of worksheets in the workbook. If you put a check in the Windows check box and click OK, the current configuration of Excel windows will be preserved for each time you open the workbook. You can apply either Structure or Windows protection to a workbook, or you can select both checkboxes and protect both the windows and the structure of your workbook. You will notice that the dialogue contains an optional Password box. If you enter a password in this box and then click OK, Excel will ask you to confirm the password. If you re-enter the password correctly and click OK, only users who know the password will be able to remove the protection you applied. If you do not use a password, any user can remove the protection simply by clicking the Unprotect Workbook button on the Review Ribbon.
This button will remove the workbook structure or windows protection that you applied. If you entered a password when you applied the protection, clicking on the Unprotect Workbook button will display the following Unprotect password box. You must enter the correct password in the field provided and click OK to remove the protection. Protecting your Worksheets Excel 2007 also allows you to protect your data on a worksheet by worksheet basis. This feature is useful for situations where users are permitted or required to modify data on one worksheet, but are forbidden to modify data in another worksheet in the same workbook. To protect a worksheet, you must click the Protect Sheet button. When you click this button, you will see the following dialogue box.
In the dialogue box, you will notice a series of checkboxes. If you place a check mark in a checkbox and then protect the sheet, a person using the spreadsheet will be able to perform the task that you checked. In other words, users will be able to perform any tasks that you select with checkmarks, and they will not be able to perform any tasks that are not checked. You will notice a checkbox at the top of the dialogue that reads Protect worksheet and contents of locked cells. If you put a check in this box, any locked cells on the sheet will be protected. The contents of a locked and protected cell cannot be edited or changed without the password. By default, all of the cells in your worksheet are locked, so when you protect the sheet, the data in the cells cannot be modified. The important concept here is that protecting your sheet with the Protect Sheet dialogue will prevent users from editing the contents of any locked cells. Since all of the cells in a worksheet are locked by default, applying worksheet protection will prevent the cells from being modified. The topic of unlocking cells will be addressed immediately after this discussion of worksheet protection. After you set up the tasks that you will allow users to perform, you can enter a password in the Protect Sheet dialogue and click OK. If you click OK without entering a password, the sheet will be protected, but you will not require a password to unprotect it (meaning any user can unprotect the sheet if it has no password). When you enter a password and click OK, Excel will ask you to re-enter the password to confirm it. If you re-enter the password correctly and then click the OK button, the worksheet will be protected. To unprotect the worksheet, you must click the Unprotect Sheet button on the Review Ribbon, and then enter the correct password to unprotect the sheet.
When you set up worksheet protection, it will be applied to the currently active sheet. To apply protection to multiple sheets, you must select each sheet (click on the sheet tab at the bottom of the screen) and apply protection to it individually. In this way, you can configure different protection options for each different sheet in your workbook. If you wish, you can use a different password to protect each sheet in your workbook (though it is probably a better idea to avoid confusion and use the same password for each sheet). Unlocking Cells If you want to prevent users from modifying the actual cell data in your worksheets, your cells must be locked and the worksheet must be protected. In Excel the cells are locked by default, so when you protect a worksheet, the cell data can no longer be modified. If you try to modify a locked cell in a protected worksheet, you will see the following warning. But suppose that you want users to be able to modify the data in some cells. To accomplish this, you must unlock the cells that you want to be editable before you protect the worksheet. To unlock cells in a worksheet, first select the cells that you want to unlock, and then invoke the Format Cells dialogue. You can do this by clicking the small arrow at the lower right of the Font button group on the Home Ribbon. When you see the Format Cells dialogue appear, click the Protection tab.
If you clear the checkmark from the checkbox labeled Locked, the cells you selected will now be unlocked. When you protect the worksheet with the Protect Sheet button on the Review Ribbon, the locked cells will not be editable, but the cells that you selected and unlocked will be editable. This means that users can modify the cells that you unlocked, but they can do nothing to the data in the other cells in the sheet. You can also password protect ranges in a locked spreadsheet. This will allow users with a password to unlock specific ranges of cells. To add this security feature to a spreadsheet, click the Allow Users To Edit Ranges button on the Review Ribbon. When you click this button, you will see the following dialogue box.
If you click the New button in the upper right of the dialogue, you will see the following New Range dialogue. Your next step is to enter a title for the password protected range in the Title field. After this, enter the cells themselves by putting the focus (cursor) in the Refers To cells field, and then selecting the cell range in question with your mouse. When the selected range is entered into the field, place your cursor in the Range Password box and enter the password for the range. When you click the OK button, you will be asked to repeat the password to ensure that it is correct. When you do this correctly, you will be returned to the Allow Users To Edit Ranges dialogue. This time, you will see the range that you protected and its title in the viewing area of the dialogue. If you want to modify the title, the password, or what cells are included in the range, you can click the Modify button.
If you want to delete the range, click the password protection for the range and click the delete button. Finally, when you click the OK button the range will be password protected. This means that when you protect the locked cells in this worksheet, users who know the password for the range can unlock the cells in the range with the password. You must enter the password to be able to edit the cells in the range, but, when you enter the password, only the range you set up for this protection will be unlocked. The rest of the spreadsheet cells will still be locked, even to the users that know the range password. Remember, the entire sheet must be protected for the range password to be useful. Otherwise, the cells will already be unlocked. If you want to be serious about preventing users from editing locked cells, you should always use a password when you apply protection to a worksheet. Protecting your Excel Files There is still another type of protection that you can apply to your Excel workbook that works on the file level. Basically, you can secure an Excel 2007 file so it cannot be opened without a password. Moreover, you can also protect an Excel file so that it cannot be modified without a password. To do this, open or create the Excel file that you want to protect, and then display the Office menu. When you see the Office menu, choose the Save as option to display the Save as dialogue box.
In the Save As dialogue, click the Tools button in the lower left, and then select General Options from the pop up menu. This action will display the following dialogue. If you enter a password in the Password to Open field and then click OK, Excel will then open a confirm dialogue box where you to type the password again to confirm it. When you click the OK button on the confirm dialogue box, the file becomes password protected. This means that when you try to open the file, you will be prompted for the password, which you must enter correctly to proceed. You can also specify a password in the Password to Modify text field. The process is exactly similar to the method just described for the Password to Open.
If you set a password to open the workbook, you will see the following box displayed after you save and then reopen the workbook. You must know the password to open this workbook. If you do know it, you can proceed to open the workbook. If you set a password to modify the workbook, you will see the following box after you save and reopen the workbook. Here the person opening the workbook has the option of clicking the read only button to open the workbook. The user will be able to view and modify the open workbook, but when they try to save it, they will not be allowed to save the modified version over the original. Excel will enforce the use of a different file name, and protect the original workbook from being modified. You can open the workbook with full privileges only if you use the password.
Lesson 5.2: Finishing Your Workbook Once you have designed and created an Excel 2007 workbook, there are a few things you might consider before you conclude that the workbook is finished. This is especially true if the workbook in question will be shared among several users. Workbooks can contain a type of information called metadata, which is quite different from the actual working data in your spreadsheets. Metadata is best defined as data that is used to describe other data. Metadata is not comprised of financial figures or formulas from your workbook. Instead, it is a set of information about your workbook, including the name of the workbook author, the date the workbook was finished, when it was accessed or modified, the file size. If you are going to distribute a workbook by one means or another, it may be important to know if any sensitive metadata is being distributed as well. As you probably already know, an Excel 2007 workbook uses a different file format from earlier versions of Excel. If you plan on distributing a workbook among several users, it is useful to know about any potential compatibility issues you workbook may have. When you have finished and checked your workbook, you may also want to mark it as final, to protect it from being overwritten, and so that anyone using the workbook will understand that it is the final version. In this lesson, you will learn about some of the features under the Prepare menu: inspecting documents for metadata, checking a workbook for compatibility, and marking a workbook as final. Using the Document Inspector You may remember from the discussion of file properties in Lesson 1.2 that there can be a fair amount of information (metadata) available on any given Excel 2007 file. If you want to see just what type of information is available and control it, you should use the Document Inspector. The inspector option can be found on the Prepare sub menu under the Office Menu.
It is a good idea to save your file before you use the Inspect Document option. This is because the feature will allow you to remove information from your workbook if you wish. If the workbook has already been saved, you will have a backup. If you haven t saved your file before you open the inspector, you will see the following alert. If you click Yes, the Save As dialogue will appear, allowing you to choose a location and name for the saved file. If you have already saved your file, or if you click the No button, the following window will appear on your screen.
If you click the Inspect button, the document inspector will search for any of the items shown in the list that have been selected with a checkmark. The document inspector will then take a few moments to inspect the workbook and then report to you what it has found.
In this example, the document inspector found Comments and Annotations, Document Properties and Personal Information, and Custom XML Data. All three of the types of information found by the inspector can provide clues as to the purpose of the workbook, the author, or other personal information related to the workbook. If you want to remove a particular category of information from the file, just click the Remove All button that is associated with the category in question. As for the example shown above, you might want to leave the comments and annotations, as these were probably included intentionally to clarify the workbook. You may, however, want to remove the Document Properties and Personal Information, so users of the file will not be able to view any personal information stored in the file properties. If you click the Remove All button corresponding to this option, the personal information in the properties will be removed. Here is the Summary tab of the Properties dialogue box for the workbook named Book3.
If you open the file, run the Document Inspector, remove document properties and personal information, and then save the file again, this information will no longer be available. The following image shows the Book3 properties after using the document inspector to remove personal information.
Similarly, you can use the Document Inspector to remove any other hidden or personal information that is found and reported in the inspection results (like hidden content, XML data, headers and footers, and so on). Using the Compatibility Checker If you intend on sharing your Excel files with other users, it is a good idea to know just what programs your files are compatible with.
The alert shown above was caused by opening an Excel 2007 workbook with the Excel 2003 program. Because Office 2007 uses a different file format, Excel 2003 cannot open the file. This would present a major problem for sharing this workbook with users that may still be using Office 2003 programs. To successfully share this file, it must be converted to Excel 97-2003 format. Thankfully, Excel 2007 provides a compatibility checker feature. This feature can help you find out more about any compatibility issues with your Excel files. You can find it in the Prepare section of the Office menu.
When you click this option, you will see the Compatibility Checker dialogue. Now you know the elements of your Excel 2007 workbook that will be lost or compromised when you save the file as an Excel 97-2003 workbook. The description of the compatibility issue tells you the name of the sheet where the issue is located (Sheet1), and what is likely to happen when you save as the given file type (in this case, any earlier version). Clicking on the Help link will open Excel s help screen. You may also see a Find link to help you find the specific feature that is causing the problem. If you click the OK button, the dialogue will close. Notice the comment at the top of the dialogue that states, The following features in this workbook are not supported by earlier versions of Excel. As you know, users of versions of Excel that are earlier than Excel 2007 will not be able to open a workbook that is saved as an Excel 2007 file. To overcome this, you will have to save your Excel 2007 workbook as an Excel 97-2003 workbook by selecting the Excel 97-2003 Workbook option from the Save as type drop list in the Save as dialogue. In the compatibility checker dialogue, you can put a check in the Check Compatibility when Saving this Workbook box and then click the OK button. When you try to save your Excel 2007 workbook as an Excel 97-2003 workbook, you will be alerted to any compatibility issues with regard to the earlier versions of Excel.
As an example, suppose your Excel 2007 workbook contains a shape with custom effects that are not supported in earlier versions of Excel.
The following image shows how the Excel 2007 graphics have been changed when the workbook is converted to Excel 97-2003 format. Knowledge of these compatibility issues will allow you to modify or change your Excel 2007 workbooks in the best way possible for sharing with other users. Marking a Workbook as Final When you have completed your workbook, and you are sure that it is set up and working in just the way you want, you can mark it as final. This will allow you to save a copy of the workbook that is read only, which means that users can view the workbook but not modify it. To mark a workbook as final, first display the Prepare options under the Office menu.
At the bottom of the menu, you will see the Mark as Final Option. When you click on the option you will see the following alert. If you click the Yes button, the workbook will be saved and marked as final. This means that anyone who uses the workbook will only be able to view the data, and not modify/delete it. The following image shows a workbook that has been marked as final.
When a workbook is marked as final, the words [Read-Only] will be visible in the title-bar. No one who views this workbook will be able to alter or delete the data or structure unless they remove the mark as final protection. To remove the Mark As Final protection, open the Office menu and then click the Prepare option to display the menu. Then, click the Mark as Final option. This will remove the read only protection from a workbook that has already been marked as final. As you can see in the following image, the words Read-Only are no longer visible in the title bar of the workbook. A user can freely edit this workbook because it is no longer Marked as Final. If you remove the Mark as Final protection, you will be prompted to save changes when you close Excel. If you do not save changes, the file will remain Marked as Final.
Lesson 5.3: Using Excel in Word Word processors are the programs of choice for creating written reports and business documents. Spreadsheet applications are the programs most frequently used to work with business data. Needless to say, situations where you need to incorporate spreadsheet data into a word processing environment are likely to occur. If you use Microsoft Word 2007 for your documents and Excel 2007 for your spreadsheets, you can include cell ranges, charts, and workbooks in your Word documents fairly seamlessly and without too much difficulty. In this lesson, you will learn how to insert Excel data into a Word document. You will also learn how to modify the data after it has been inserted. You will learn about linking Excel data to Word documents, and how to include Excel charts in Word documents. Inserting Excel Data in Word Essentially, you have four options for including Excel data in a Word document. You can simply type the required data in, you can copy and paste the data in, you can insert (embed) the data into your document, or you can link the Excel data to your document. For anything but trivial amounts of data, the first option becomes impractical. You can do a simple copy and paste to include the data, but this will limit your options when it comes to later formatting, updating, or modifying the data. Your two best options are to insert (embed) the data into your Word document, or link the Excel data to your document. Inserting an Excel range or worksheet will increase the size of your Word document. Depending on how much data you want to include, the size increase can be significant. Moreover, updates or changes to the data in the source worksheet will not be automatically updated in the Word document. On the other hand, the Excel data can still be edited with Excel, even though it is embedded in a Word document. Your document will also be more portable, because it does not need to maintain a link to the original Excel file. If you insert data that is linked to a file, your document size may be smaller, but you will have to make sure that the original file is always available. If it is not available, the document that you inserted the linked data in may not function properly. To insert Excel data into a Word 2007 document, open Word 2007, and display the Insert Ribbon by clicking the Insert tab.
At the right of the insert tab, you will see an Object button. Click this button to display the Object dialogue box. Under the Create from File tab, use the Browse control to find and select the workbook that you would like to embed into your document. Please note that you can use checkboxes to specify if you want the embedded object to be linked to the original file or displayed as an icon. For this example, both checkboxes are left clear because we want to embed the data without any dependency on the original file, and we do not want an Excel icon to appear in our Word document.
Once you have found the Excel workbook that you want to embed, click the Insert button in the lower right to continue. (Remember to ensure that the All Files option is specified in the Files of type field, to help you find the file you are looking for.) When the Object dialogue reappears, click the OK button.
As a result of these actions, the data from the Excel workbook that you selected will be inserted into your Word 2007 document. If you put a check in the Link to File checkbox before you click OK, the embedded object will be linked to the original workbook file. This means that if the original workbook file is removed or corrupted, you may not be able to open the Word document that is linked to it. If you can open the document, you will not be able to edit the embedded data in Excel.
Since we left the Link to File checkbox clear when we inserted the data, the Word document will not be dependent on the original file. If anything happens to the original workbook, the Word document will still function normally. It is quite possible that your Excel workbook will contain so much data that it cannot be displayed in your Word document properly. As you can see in this image, the data is running off of the right side of the page. To overcome this, you can insert only a selection of data from the workbook, or you can display the inserted data as an icon. To display the data as an icon, check the Display as Icon check box in the Object dialogue when you are inserting the data. Here you can see a large workbook represented as an icon in the Word document.
Because the workbook was inserted without linking it to the original file, even if the original workbook file is deleted, clicking the icon in the Word document will open the data. Linking Excel Data in a Word Document If you link Excel data to a Word document, any updates or changes to the source Excel file will be automatically updated in the Word document. As well, the size of the Word document will not increase to the extent that it does when inserting (embedding) Excel data. On the other hand, if the location of the Excel file is changed, or the Word document with the linked data is relocated, the link will be broken. Linking makes your document less portable. There are a couple of ways to link your Excel data to a Word 2007 document. If you would like to link only part of a workbook or worksheet to your Word document, the first step is to select the cells from your workbook that you want to insert. After you make your selection, right click on one of the selected cells and then click the Copy item from the pop up menu which will surround your selection with a flashing dashed border. The next step is to place your cursor in the appropriate position in your Word document, and then choose Paste Special from the left side of the Home Ribbon.
When the Paste Special dialogue appears, select the Paste Link radio button, and choose the Microsoft Office Excel Worksheet Object option from the list provided. Once you are ready, click the OK button in the lower right of the dialogue. The selected cells that you copied from the workbook will now be embedded into your Word document. Because this data is linked to the original file, any updates to the data in the original file will be automatically updated in the Word document when it is opened, or when you right click on the embedded data and select Update Link from the menu that appears.
Clicking the Update Link option will update any data that has been changed in the original linked workbook. You can also link your embedded data to the original Excel file by using the Object dialogue box.
When you are about to insert Excel data using the Create from File tab in the Object dialogue, you can put a check in the Link to File checkbox, and then click the OK button. When you do this, the workbook data will be linked into the Word document in a way that looks just like inserting an unlinked object. Because the inserted data has been linked to the original file, you will be able to refresh the data in the Word document to include any updates to the data in the workbook. Once again, to refresh the data, right click on the inserted data in your Word document and click the Update Link option in the pop up menu. Modifying Excel Data after Insertion If you have inserted Excel data into a Word document, you can view and modify the data without to much difficulty. The following image shows some data from an Excel worksheet that has been inserted into a Word 2007 document. If you right click on the Excel data and choose Worksheet Object from the pop up menu, followed by Edit from the sub menu, the worksheet will open in a restricted Excel environment from within your Word document. You can now edit the data. Even though you are editing the data in an Excel environment, the changes you make to your data in the Word document will not be carried over to the original Excel file. The reverse is also true because the worksheet data is not linked. (This means that
updates to the original Excel worksheet will not be automatically updated in the Word document.) If you click on the margin outside the data, the Excel editing environment will close. If you right click on the Excel data and choose Worksheet Object, and then choose Open from the sub menu, the worksheet will open in a full Excel screen. This allows you to insert columns or rows, or apply formatting from the Excel toolbars. Any changes you make to the data in this environment will not be carried over to the original Excel file. If you have inserted a Linked object into your Word document, you can double click on the data in your Word document, and the Excel data will open in a full Excel environment. If you edit the data in the Excel environment, the changes will automatically be updated in the Word document. When you close the Excel environment, you will be asked if you want to save changes to the Excel workbook in question. If you choose not to, the Excel workbook will close without keeping the changes. The Word document, however, will retain the changes you made (unless it is updated/refreshed from the original linked workbook). Insert an Excel Chart into a Word Document If you want to include a graphical representation of your data, you can also insert an Excel chart into a Word document. To do this, open both Word and Excel. Next, select the chart from your Excel worksheet.
You can select the chart by clicking on the chart area so that it is outlined with a border. Then, click the Copy button from the Clipboard button group on the Home Ribbon. After you have selected the chart and copied it to the clipboard in Excel, switch to your Word document and position your cursor at the spot where you want paste the chart. Right click and select Paste from the pop up menu to paste the Excel chart into Word.
If you display the menu of the paste options button (in the lower right corner of the newly pasted chart), you will see that the chart will be linked to the original Excel chart by default. If you want, you can select the Paste as Picture option and the chart will be saved in your Word document as a normal image. Because the pasted chart is linked to the original Excel chart by default, any changes you make to the chart in your original Excel workbook will be updated and reflected in the chart in your word document. (This is very similar to the linking of Excel data discussed previously.) If the original Excel chart is removed from a spreadsheet, or the workbook containing the chart is deleted, nothing will happen to the chart that has been pasted into Word. If you want to edit the look and style of your chart from within Word, click on the chart area, and a Design Ribbon with chart tools will be available at the top of your Word screen.
If you edit the data, or change the data source in the original Excel chart, the Word chart will reflect the changes automatically.
Lesson 5.4: Using Excel and Access Spreadsheet programs are often used to organize, analyze, process, and present data. Database applications are often used to store, retrieve, filter, and query data. Because spreadsheet applications and database applications complement each other in this way, the ability to share data between them can be quite useful. Access 2007 is the latest version of Microsoft s popular database program. In this lesson, you will learn how to link an Excel workbook to an Access database, how to retrieve data from an Access database for PivotCharts and PivotTables, and how to transform an Excel workbook into an Access database. Linking an Excel Workbook to an Access Database To link an Excel workbook to an Access database, open Access 2007 and select the New option from the Office menu. When you see the Getting Started with Microsoft Access screen, click Blank Database under the New Blank Database heading, and then enter a name for your new database in the File Name field provided in the lower right. When you are ready, click the Create button in the lower right to create a blank database.
When you create a new blank database, you will see an External Data tab at the top of the Access 2007 screen. Clicking on this tab will expose the External Data Ribbon. On the ribbon, you will see an Excel button in the Import button group. When you click this button, you will see the Get External Data dialogue shown below. In this dialogue box, you can use the Browse button to display an open dialogue that allows you to navigate to and select the Excel workbook of your choice. Once you have selected the workbook that is to be the source of your link, click the Link to the data source by creating a linked table radio button. When this button is selected, and the workbook you want to link is in the File Name field, click the OK button to continue.
When you click the OK button, the next stage in the process will begin with the appearance of the Link Spreadsheet wizard. In this stage of the wizard, you can choose which worksheet to link data from. If there are named ranges in your worksheet, you can activate the Show Named Ranges radio button which will display a list of range names in your workbook that you can choose from. A display of the data from the selected range or sheet will be shown in the large preview area of the wizard.
If you click the Next button, you will see the next stage of the wizard. In this stage, you can specify with if the first row of your linked data will be used as the field names for the new Access data table. If you click the Next button, a field will be provided so you can enter a name for the linked database table. If you choose to click the Finish button, the linked table will be created with a default name (i.e. Sheet1). When you click the finish button you will see the following alert.
If you click OK, the linked Access 2007 data table will be created. Since the data in the Access table is linked to a spreadsheet, any changes to the corresponding data in the spreadsheet will be automatically updated in the table when you open the Access database containing the linked data. You can run queries on the linked table and present the linked data in Access Forms and Reports just as you could with a regular Access table. Remember though, that the data is linked; if the original Excel spreadsheet is removed or relocated, the link will be broken, and the Access table will not be refreshed or updated. As a matter of fact, if the link is broken the data for the linked table will not be found at all and the table will not open in Access. If you try to change the value of the linked data from within Access, you will not be able to. This must be done from within Excel, although you can format the data within Access. Importing Table, PivotTable, and PivotChart Data from Access You can certainly do more with Excel and Access than just link Excel data to an Access database. Another interesting possibility is to create tables, PivotTables, and PivotCharts based on Access 2007 data. You have learned quite a bit about Excel tables previously in this manual. As far as PivotTables go, they are basically a special table in Excel that helps you dynamically reconfigure data display to discern relationships between your rows and columns of data. A PivotChart is simply a special chart based on an Excel PivotTable. (PivotTables will be dealt with in detail in the Excel 2007 advanced manual.) To create a PivotTable based on data from an Access database, you must display Excel s Data Ribbon.
If you click the From Access button in the Get External Data button group, you will see a Select Data Source dialogue box that will allow you to navigate to the Access 2007 database that will serve as the source of the data. When you have chosen your data source, click the Open button on the lower right of the dialogue to display the next dialogue box.
If the Access database in question has multiple tables, you will be presented with the Select Table dialogue. In this dialogue you can choose the table that contains your source data, and then click the OK button to continue. If the Access database has only one table, the Select Table dialogue will not appear. The next step is to use the Import Data panel to select how you want to view the imported data in Excel. You can choose to display the data as a Table, a PivotTable, or a PivotChart and PivotTable report. You can also specify where you want to place the imported data (i.e. an existing worksheet, or a new worksheet). If you select the Existing Worksheet option, the table you create will be located at the position of the active cell or at a cell you specify.
If you click the Properties button, you will see the following Connection Properties dialogue box. In this box you can enable or disable refresh control functions. If you put a check by Refresh data on file open, the table data will be refreshed from the database when you open the Excel workbook. You can also specify how much time should pass between refreshes with the Refresh every check box. When everything is set the way you want, click OK to implement the changes and return to the Import Data panel. When you have selected the type of table that you want with the radio buttons in the Import Data panel, click the OK button to create the type of table that you specified.
Here is the original data from the Access 2007 database. Here is a standard Excel table based on imported data from the database. Here is a PivotTable report based on imported data from the database.
If you right click on the table you created in Excel, and click the Refresh option from the pop up menu that appears, the data in your Excel table will be updated with any changes made to the source data in the database. Transforming an Excel Workbook into an Access Database A large database can be quite complex in design, with multiple tables and relationships linking huge amounts of data. Since this is an Excel manual, we will not delve into the details of relational databases and their design. (If you are interested in these topics, you may want to explore our Access courseware.) However, we can explore how to create a simple Access 2007 database from an Excel 2007 workbook. The basic structure behind a database is a collection of separate tables, with each table containing information about some type of entity. Each table will normally hold many separate instances (or records) for the entity it represents. The tricky part of converting an Excel workbook into an Access database is creating the separate database tables from the different data regions in your workbook. The first step in transforming a workbook into a database is opening Access 2007. Once Access is open, create a new blank database.
When the new database opens, you should click the External Data tab to display the External Data Ribbon. The next step is to click the Excel button in the Get External Data button group. This will display the following Get External Data dialogue. Use the Browse button to navigate to the Excel worksheet that you want to use, and make sure that the Import the source data into a new table in the current database radio button is selected. Once you are ready, just click the OK button to continue. The Import Spreadsheet wizard should now appear on your screen.
You should use this stage of the spreadsheet wizard to choose the worksheet or named range that you want to use to create your first database table. The Excel workbook in question has a set of data on each of its three sheets. Logically, we will want a separate Access database table for the data in each separate worksheet. This will create our underlying database structure. In the image shown above, Sheet1 is selected. This means that the database table we create will be made from data in the worksheet named Sheet1. Clicking the Next button will display the next stage of the wizard.
In this part of the wizard, you can specify that the first row of Excel data will be used as field names. Once again, when you are ready to continue, click Next. In this stage of the spreadsheet wizard, you can modify the information relating to each table field that will be created from the Excel data. You can change the data type of the field, the field name, and more by clicking in each section (field area defined by vertical lines) and then modifying the entries in the Field Options area near the top of the dialogue. You do not have to adjust the Field Options at this point if you do not want to. You can go ahead and create the table first, and then adjust the field options all you want from within Access. To move to the next stage of the wizard, click the Next button.
This part of the wizard is used to define a primary key for your new table. A primary key is a field that will be used to relate this table with the other tables in the database. Database keys and relationships are an important subject, but they are not required knowledge for the purposes of this discussion. If you understand database relationships, go ahead and assign a primary key at this point if you wish. If you click the Next button, a field will be provided that you can use to name your table. At this point, clicking the Finish button will complete your table. As mentioned previously, a database can be based on a collection of tables. If there is more data in the Excel workbook that you would like to transform into a database table (i.e. data on other worksheets) just perform the procedure discussed over again.
For example, if you click the Excel button in the Get External Data button group again, you can step through the Import Spreadsheet wizard again. Remember to specify that you are importing the source data into a new table in the current database. This time, you will want to select a different worksheet or named range from the sheet you imported before. Now you can use this data to create a second table for your database (if a second table is required). You can continue to import your Excel data into Access database tables until you have created a complete database. Once your database tables are complete, you can use Access to add to or modify them as required. Any database that you create in this way is totally independent of the original Excel workbook that it is based on.
Lesson 5.5: Using Excel With other Programs and Files You have seen how Excel 2007 can be used with Microsoft Word. Now it is time to explore how Excel can be used with other programs. In this lesson, you will learn how to send Excel workbooks by e-mail with Microsoft Outlook. You will learn how to open Excel files in a different format, how to import data from a text file, and how to import data from another program. Using Outlook to Send Excel Data If you do a lot of work with Excel, sooner or later you will want to be able to send your Excel data to your colleagues. You may be required to design a workbook for someone else to use, or you may need to send some data to a co worker for review. Whether the recipient is on the local office network, or a thousand miles away, if they have an e-mail address it is easy to get your Excel data to them. You can send an Excel 2007 workbook as an e-mail attachment from within Excel, by first exposing the Office menu and then displaying the Send submenu.
In the Send menu, click on the E-mail option to display the Outlook e-mail window. (If you do not use Outlook for e-mail, this screen will be different.)
You should see that your current workbook has been attached to the outgoing message. Next, enter the e-mail address of the recipient, enter a subject in the subject line, and then type any message that you want to accompany your attached workbook. After your e-mail is complete, click the Send button to send your workbook to the specified recipients. Since your workbook is being sent as an e-mail attachment, your recipients must have a compatible version of Excel to be able to open, use, or modify the workbook. Opening an Excel File in a Different Format There is no guarantee that everyone who has to open an Excel file has access to the same software. Even in a single company or organization, differences in computing power from machine to machine can limit the software being used. In any case, you may have to send an Excel 2007 workbook to someone that does not have the most recent version of Excel installed on their system. You might even find yourself trying to view an Excel workbook on a platform that has another spreadsheet application installed, or no spreadsheet application at all.
Excel 2007 has the capability to save data in more than one file format. You can save data as a text file, as a worksheet from an earlier version of Excel, as an XML file, and as a web page. To save an Excel 2007 work book in a different format, click the Save As option from office menu, or press the F12 key. Both of these actions will display the Save As dialogue box. In the Save As dialogue you can use the tools on the left to navigate to the location where your file will be saved, and you can enter a name for your file in the File Name field. When you are ready to save your file, expose the Save As Type drop list by clicking the arrow at the right of the Save As Type field. This will display a list of different file format options that you can choose from. To save your Excel file as a different file format, choose the most suitable format from among the options provided in the list. For this example, the workbook data will be saved in CSV, or comma separated value format. This is a simple format that can be accessed by almost any spreadsheet application. Furthermore, it is fairly straightforward for programmers to develop software that can deal with CSV files. When you have decided on a file format, click the Save button to save your Excel data under the format you selected.
Here is the worksheet we are saving. For this example, we will save the worksheet data as a CSV file, which will cause the following alert to appear. Clicking OK will generate another alert.
Clicking the Yes button will save the worksheet as a CSV file. This is the CSV file as displayed in a basic text editor. This file can be opened by a wide variety of applications ranging from simple text editors to word processors, to spreadsheet and database applications.
This image shows the same CSV file opened in Microsoft Word 2003. Here is the same CSV file opened as a Microsoft Access 2003 base.
If you want to, you can easily open an Excel 2007 File as an Access 2007 database table (without first converting it to a CSV file). To open this Excel spreadsheet in Access, start Access 2007 and choose Open from the Office menu. Next, select the Excel file in question. (Make sure that the file type in the Open dialogue box is set to All Files so Excel 2007 workbooks will be visible.) When you have selected the appropriate Excel workbook, click the Open button in the lower right of the dialogue. When you do this, the Access Link Spreadsheet wizard will appear.
Here you can choose which worksheet from your Excel 2007 workbook will be used. (In this case, Sheet1 contains the data that is required.) When you click the Next button, Access 2007 will display the next stage of the Link Spreadsheet wizard. At this point, you can specify that the first row of data from your spreadsheet will contain the database table s field headings. If you click the Finish button, the Excel 2007 spreadsheet will now be available in Access 2007 as a database table.
Importing Data from a Text File There can be times when you want to open a file in Excel, but the file is not an Excel workbook (does not have the.xls extension). Perhaps the file is a word processing document from Word or WordPerfect, or maybe it is an e-mail or a simple text file. Copying the data from the source file and pasting it into Excel is an option, but this can be tricky if you have large amounts of information, or if you want to impose structure on the data. Luckily, if you can convert the data you want to a basic text file, Excel 2007 makes it fairly easy to import it into a worksheet. If the data you want is in a Word document, or some other word processing format, explore the save options for the file. Most word processors will allow you to save a file as plain text (.txt). Another option is to copy the data you want and paste it into a simple text editor like Notepad. Use the text editor to clean up the data and then save it as a plain text file. Here is a simple Word 2007 document. If you use the Save As dialogue box to save the document as a plain text file, you will be able import the data easily into Excel 2007. Once you have the data you need stored as a text file, open Excel and choose Open from the Office menu. In the Open dialogue box, make sure you select the All Files or Text Files option from the Files of Type: drop list, so you can see the text files that are available to you. In the Open dialogue, choose the text file that you want to import and click the Open button to display the Text Import Wizard.
In the first step of the text wizard, Excel will try to determine how your data is arranged. There are two radio buttons shown under the Original Data Type heading. Choose Delimited if you the imported data is organized by delimiters (separators like commas, semicolons, or tabs) in the text file. Choose Fixed Width if the data in the text file is aligned in columns separated by spaces. (Note that there is an area near the bottom of the wizard dialogue box that previews the organization of the text file.) You can also select the row where Excel will start importing the data. When you are ready to proceed, click the Next button to move on to step 2 of the wizard.
In Step 2 of the wizard, you can add, move, or delete column breaks as required. You can drag the lines as required to adjust what the Excel columns will contain. You can also click to create a new line or double click to delete one. Once the column breaks are set up the way you like, click Next to move to step 3.
In Step 3, Excel allows you to select a format for each column. You can click on heading at the top of each individual column (the heading is General by default) and choose from the radio buttons to format the column as Text, Date, or General. You can also choose not to include a column if you wish. When everything is ready, click Finish to import the data. This is an image of the same data, imported into Excel 2007.
Importing Data from External Data Sources It can often be the case that the data you need for your Excel worksheet is stored in a database application. Database applications are great for managing, maintaining, and retrieving huge amounts of data. Database programs also provide features for defining relationships between data entities, for developing queries to extract information, and for securing sensitive information. For these reasons and more, organizations often make extensive use of databases. Luckily, Excel 2007 allows you to import data from a number of external sources. Moreover, the imported data can be linked to the source, so that changes to the underlying source data tables can be refreshed and updated in your Excel worksheets. The Microsoft Office 2007 suite provides drivers (software that helps other programs communicate) that will allow Excel 2007 to connect to a wide array of data sources. Some (but not all) of the data sources that you can connect to with Excel 2007 are: Microsoft SQL Server Microsoft Access dbase OLAP cubes Oracle Paradox Microsoft FoxPro SQL Server Analysis Services Cube Text files Connections to external data in the current workbook can be viewed and refreshed with the Connections button group on the Data Ribbon.
The data connections themselves can be created with the controls in the Get External Data button group (also on the Data Ribbon). The menu under the From Other Sources button will display a number of options for connections to external data. The bottom option in this menu, Microsoft Query, is a powerful tool that will allow you to create a connection and build a query to extract very specific information from a given database. If you click on the Microsoft Query option, you will see the following dialogue.
If you select the <New data source option> and click OK, you will be presented with a dialogue with options for specifying the name and driver type for the new data source. After you have selected a name and a driver that is appropriate for the data source, you can click the Connect button to establish a connection. When you click this button, you may be asked for information by the MS Query driver. Just enter the information that is requested in the fields provided.
Once this named connection is created, it will appear in the Choose Data Source box. Here, a new data source named test has been created. Just select it and click OK to display the Query Wizard. You can use the query wizard to extract data from your data source. We will use the query wizard in the Practice Exercise at the end of this lesson. If you click on the Existing Connections button in the Get External Data button group on the Data Ribbon, you will see a list of some established connections (if there are any) in the given workbook. These are connections that have already been created and used in an Excel workbook (such as imported table data from an Access database).
If you click on an item in this list, you will see the data options that are available from the given connection. In this example, the Cars item (an Access database) is selected. Here are the available data options associated with the Car connection item. If you select one of the database tables and click the OK button, you will be presented with the Import Data panel.
You may recognize the Import Data panel from Lesson 5.4 (Using Excel and Access). We can use this connection over and over again to import data form the database, as long as the database and the connection persists (i.e. the database is not deleted or removed and the link to the database location is maintained). In the end, the source you choose for your external data connections will depend on the configuration of your network and the database applications that you have access to. Publishing a Workbook as a PDF File Sometimes it is convenient to transform your worksheets into a format that is better suited to online distribution or publishing. Often, documents that are distributed online are published in a PDF (portable document format). These PDF files (that are viewed with programs like Adobe Acrobat), can contain images and text in a fairly small file size. To publish your Excel Workbook as a PDF file, you must first download the add-in from Office Online. First, open Internet Explorer. Then, visit http://office.microsoft.com. At the top of the window, type PDF in the search window and then click Downloads for the type. Click Go to perform the search.
(Please note that Web sites can and do change!) Once you click Go, a results page will be displayed. Find the Office 2007 Microsoft Office Add-in: Microsoft Save as PDF or XPS link and click it. Then, follow the instructions on the screen to download and install the add-in.
Now, you should see a Publish to PDF or XPS option under the Save As menu in the Office menu. If you click on this option, you will see a Publish as PDF or XPS dialogue box.
In the dialogue box, you should make sure that PDF is specified in the Save As Type field. You can also choose if the document should be published in Standard size (good for printing), or in Minimum Size (best for online publishing). You can specify your choice by selecting the appropriate radio button at the bottom of the dialogue. If you click the Options button, you will see an Options dialogue appear on your screen.
With this dialogue you can specify specific worksheets to be published as PDF, or you can specify a selection or the entire workbook. You can also ensure that the PDF is ISO compliant by putting a check in the box at the bottom. There are also checkboxes that will allow you to include or exclude non-printing information such as file properties or document structure information. Once you have chosen the settings you want, you can click the OK button to return to the Publish as PDF or XPS dialogue. You should make sure the file has a name in the File Name field of the dialogue and that the correct save location is specified in the Save In field. Once everything is ready, click the Publish button to create the PDF file. Here is the original Excel document.
Here is the PDF version of the same document. Faxing a Workbook If you are ever required to get your Excel 2007 data to someone via a fax, you can send an Internet Fax of your workbook from within Excel 2007. To do this, display the Office menu, followed by the Send sub menu.
On the Send sub menu, you will see an Internet Fax option. Clicking this option will start the Internet Fax process. If you are not signed up with an Internet Fax provider, you will see the following alert. Basically, Internet faxes work by e-mailing your Excel data as an image attachment to an Internet fax service. This service will automatically fax your attached Excel data to the fax number that you include in the e-mail. To summarize, you must have an Internet connection and you must be signed on with an Internet fax service to send Faxes from within Excel. If you click the OK button on the alert shown above, you will see a web page open in your browser that will show some available Internet fax service providers that you can sign up with.
If you are signed up with a fax service, clicking the Internet fax option from the Send sub menu will open an Outlook e-mail with an image (in.tif format) of your data attached. The e-mail will have fields for Fax Recipient and Fax Number which you must fill out so your fax can reach its intended destination. It is also recommended that you complete the cover sheet in the body of the e-mail. When you are ready, click Send to send the fax. The e-mail and attached data will be sent to your Internet fax provider (as an e-mail) and they will automatically fax the attached data to your intended recipient. The Internet fax option does not require a dedicated telephone line like a traditional fax machine.
Section 5: Review Questions 1. What does it mean to protect workbook structure? A. Worksheets cannot be deleted, removed, or renamed B. Cells cannot be modified C. A and B D. None of the above 2. What happens to spreadsheet cells when you protect a worksheet? A. The cells become locked B. The cells become unlocked C. Unlocked cells become invisible D. Locked cells cannot be modified 3. What is the purpose of password access to a range of data? A. To grant only certain users the ability to modify certain data B. To protect other cells in the workbook C. To control access of deferent users to different data ranges D. All of the above 4. A strong password should be A. A person s name B. An easily remembered word C. The first 6 letters on the keyboard qwerty D. 6 or more characters combining upper and lowercase letters and numbers 5. The Document inspector checks documents for A. Spelling mistakes B. Formula errors C. Metadata D. None of the above 6. The Compatibility Checker looks for A. Spelling Mistakes B. Formula errors C. Metadata D. File format elements that are not supported across formats
7. When you mark a workbook as final it becomes A. Read only B. Password protected C. Hidden D. None of the above 8. Which of the following statements is true? A. Excel can only import data from Access B. Excel can only import data from text files C. Excel can import data from several different data sources D. Excel cannot import data 9. MS Query is A. A way of finding help on Microsoft Office B. An Excel statistical function C. A way to connect to and import data from an external source D. None of the above 10. To fax an Excel workbook, you need A. A telephone line B. An Internet connection and an Internet fax service C. You cannot fax an Excel workbook D. A or B