Microsoft Office 2007
Referencing other applications exercise
Average difficulty

This Microsoft Office 2007 REFERENCING OTHER APPLICATIONS exercise is provided to allow potential course delegates to assess their suitability for the Wise Owl EXCEL 2007 VISUAL BASIC course only, and may not be reproduced in whole or in part in any format without the prior written consent of Wise Owl.

Exercise: Using FileSystemObjects to sign workbooks and manipulate files

A full answer to this exercise is provided as part of the training course!

1) Download the files needed to start this exercise: exercise-925.zip (and click here if you experience any problems unzipping this file after downloading it).
2) The folder shown above contains a number of files, some of which are Excel workbooks.
3) Create a macro to loop over all of the files in the folder.  Your macro should:
  • Check for each file whether it is an Excel workbook (ie use the RIGHT function to check whether the right-most 4 characters of the file name are XLSX)
  • Open up the workbook with the given path
  • Write your name into cell B2
  • Close the workbook back down, saving any changes
Training exercise hint If you can't remember how to open and close workbooks - record a macro!
4) When you have got the macro to work, save it as Signing workbooks.xlsm, then close it down.
5) If you want another challenge, given the files in the folder above, create a macro in a new workbook which:
  • Creates a new folder on your C drive with a name of your choice, if it doesn't already exist
  • Copies all of the TXT files shown above into this folder
  • Deletes the file called Po.txt
  • Renames Laa Laa.txt to Yellow teletubbie.txt
6) Save this workbook as Various file tasks.xlsm, then close it down.

Thank you for showing an interest in this Excel 2007 Visual Basic training course! As mentioned above, full answers to this and other exercises are provided on the course. On all Wise Owl scheduled courses delegates can take away these model answers (together with their own efforts!) on a free USB stick.

All content � Wise Owl Business Solutions Ltd 2007.  All rights reserved.  Design by Branches.