Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.access.modulesdaovba,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.worksheetfunctinos
|
|||
|
|||
Opening an Excel workbook with VBA from Access
I've experimented with the workbook.open method in VBA, but seem to be
getting better results with the following code. I can't see that there is a setting with the code below that can be used to prevent the user from receiving a notification later when the Excel file is no longer read only and has been unlocked for editing. This can be done of course in the workbook open method. I would appreciate hearing whether this can be done in the code below. Bill ____________________________________ Dim xlApp As Excel.Workbook Dim xlWindow As Excel.Window 'Check to see if the file name passed in to 'the procedure is valid If Dir(Path) = "" Then MsgBox "'" & Path & "' isn't a valid path!" Exit Sub Else Set xlApp = GetObject(Path) 'Show the Excel Application Window xlApp.Parent.Visible = True 'Unhide each window in the WorkBook For Each xlWindow In xlApp.Windows xlWindow.Visible = True Next 'Prevent Excel from prompting to save changes 'to the workbook when the user exits xlApp.Saved = True End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Opening an Excel workbook with VBA from Access | Excel Worksheet Functions | |||
Slow Opening Excel Workbook from Access | Excel Programming | |||
Unprotect a workbook while opening from Access | Excel Programming | |||
user cannot access his share workbook after opening network path. | Excel Discussion (Misc queries) | |||
excel VBA problem - setting workbook as variable & opening/re-opening | Excel Programming |