

Set TEMPFORM = ActivePresentation.VBProject. _Įnd Function Function CREATE_FORM(TEMPFORM) _Īnd Left(VBComp.Name, 9) = "UserForm1" ThenĮnd Function Function DELETE_POWERPOINT_FORM()įor Each VBComp In Presentations(MAC_BOOK). ' Set UserForm1 with file information select fileįor Each VBComp In Workbooks(MAC_BOOK). If InStr(Application.Name, "PowerPoint") Then Review the following code, copy it to Excel, Word or PowerPoint and execute it. To copy the file names in the current directory to an Excel workbook, a Word document or a PowerPoint presentation try the document, files in directory. When this reference in not available the Compile Error: User-defined type not defined will interrupt the macro. To use these macros requires making available the reference "Microsoft Visual Basic for Applications Extensibility 5.3" in Visual Basic Editor.

After starting the USER_FORM macro Userform1 is shown to initiate a response to select a file from the current directory. The SELECT_FILE VBA macro will add the name of the current directory to one listbox and every file name in the current directory to another listbox. Each application requires its own Set TempForm statement to use 'ActiveDocument' for Word, 'ActiveWorkbook' for Excel, and 'ActivePresentation' for PowerPoint.
SAS LIBNAME FOR EXCEL MAC CODE
The CREATE_FORM VBA macro will create a user form with 2 labels, 2 listboxs, 2 command buttons, and code to give the command buttons function. Their is a delete function for each application (Excel, PowerPoint, and Word) to make the USER_FORM routine re-runable.
