![]() Or you can adapt the Open Excel File function above to create a function to open a Word document from Access VBA. Set WordDoc = CreateObject("Word.Application") The following code will allow you to open your Word document using Access: Dim WordDoc As Object Note: You would do this in the VBE by going to Tools>References and ticking Microsoft Word 15.0 Object Library. Set myWorkbook = (strFilePath)Ĭall OpenExcelFile("C:\Users\StevePC2\Downloads\test.xlsx")Įnd Sub Open Word Document Using Access VBAįirst set a reference to the Word Library for the Access VBA Environment. the PIAs are automatically installed to a Microsoft Excel 15.0 Object Library, Microsoft.Office. Set appExcel = CreateObject("Excel.Application") Add a reference to Microsoft Excel Object Library. ![]() ![]() 'Required: Tools > Refences: Add reference to Microsoft Excel Object Library Public Function OpenExcelFile(strFilePath As String) As Boolean This function below will open an Excel file with Access VBA.īefore using the function, make sure to add a reference to Microsoft Excel Object Library by going to Tools > References and checking Microsoft Excel Object Library. Documentation Directory General Information Quality Assurance and Productivity Desktop Frameworks and Libraries Web Mobile Enterprise and Analytic Tools.
0 Comments
Leave a Reply. |