VBA for Modelers: Developing Decision Support Systems with Microsoft Office Excel
The "CP212 Exam Preparation Guide" is a concise document designed to assist students in preparing for the "Windows Application Programming" course. It revolves around using VBA for Windows application development, with the main reference being the textbook "VBA for Modellers." The guide likely cove...
Run time errors:
● Two options
○ Ignore error
○ create special code to deal with the situation
● Option 1 - Ignore error
○ On Error Resume Next ‘turns on error handling
Appliation.DisplayAlerts = False
Code that may cause error goes here
On Error GoTo 0 ‘turns off error handling
● Display a message on error with Err Object
○ When an error occurs, an Err object is created
○ The default Number property of the built-in Err object has a nonzero value that an
If statement can check for.
○
● Option 2 - Handle the error/Write an Error Handler
, ○
○
■ In the label, if you want to return to the line after the one that caused the
error, use the statement Resume Next.
Chapter 13 - Working with Files and Folders
● Dialogue Boxes for File Operations
○ The FileDialogue object can be used to Open and Save different office file format
○ Different versions of FileDIalogue:
■ msoFileDialogOpen
■ msoFileDialogSaveAs
■ msoFileDialogFilePicker
● user can select multiple files
● All selected files are stored in the SelectedItems collection
■ msoFileDialogFolderPicker
● User select a folder from a dialog box
● Unless Cancel is clicked, the folder is stored it as
Selectedltems(1).
, ○
● The FileSystemObject Object
○ Used to check whether a file exists, rename a file, …. Etc
○ Declare FileSystemObject
■
○ Methods of FileSystemObject include: CreateFolder, CopyFolder, DeleteFolder,
CreateFile, DeleteFile, CopyFile, FileExists, and GetFolder
● Working with Text Files
○
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller WilfridLaurier. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $8.29. You're not tied to anything after your purchase.