Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Một điều mà bạn có thể làm với offset là quá trình một danh sách có cấu trúc. Danh sách cấu trúc, tôi có nghĩa là một danh sách các hạng mục trên một bảng tính mà bạn biết thứ tự hoặc cấu trúc của các cột trước thời hạn. Hãy xem xét danh sách các mặt hàng thể hiện trong hình 8,8. Một cách bạn có thể | 286 chapter 13 excel development best practices Finally chances are that the version of Microsoft Windows you use is geared toward supporting multiple users on the same computer. In order to support this capability each user s files should be kept separate from other users files. In order to play by the rules your application shouldn t force users to store user-specific information in a common file location. For example it shouldn t force everyone to store their files in a folder named C Excel Application Reports. Tips for Creating Portable Applications So what can you do to create portable applications Here are a few things to keep in mind when coding for workbook portability. Use configurable relative paths to any application-specific folders. It is easy to allow the user to choose the names of these folders. If you do use application-specific folders check for the presence of these folders in the Workbook Open event. If they don t exist offer to create them. Always validate file locations and check to make sure files exist before using them. Avoid using registry keys or INI files. If you can t create a portable application provide a way for users to export key sections of the workbook such as reports to code- and link-free workbooks. Test the Water before Jumping In I ve analyzed several procedures related to validating object names before setting a reference to an object by name. Remember always check worksheet names range names filenames Setting names if you re using the Settings class from the last chapter and any other object name before you explicitly set an object reference using the name. One of the differences between developing in VBA with Excel as a host and developing a standalone application with a traditional programming language is that when you develop in Excel you don t have 100-percent control over how a user interacts with your application therefore you need to be wary of things that the end user could do that would affect whether your program