Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm opening Excel workbook from MS Access. The program
checks whether the file is opened. When the file is not opened, it's working good enough. But, when it's opened, after a user click Ok for macros and read-only, it appears for a moment and disappears. Could anybody advise anything? Thanks Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet Dim strFileName As String, _ logFileIsOpened As Boolean strFileName = "Filename" logFileIsOpend = False Set xlApp = CreateObject("Excel.Application") DoCmd.SetWarnings False xlApp.DisplayAlerts = False xlApp.AskToUpdateLinks = False logFileIsOpened = FileLocked(strFileName) If logFileIsOpened = True Then Set xlBook = GetObject(strFileName) Set xlSheet = xlBook.Worksheets(strRecipeNum) xlSheet.Activate DoCmd.SetWarnings True xlBook.Application.DisplayAlerts = True xlBook.Application.AskToUpdateLinks = True xlBook.Application.Visible = True xlSheet.Visible = xlSheetVisible Else Set xlBook = xlApp.Workbooks.Open(strFileName) Set xlSheet = xlBook.Worksheets(strRecipeNum) xlSheet.Activate DoCmd.SetWarnings True xlApp.DisplayAlerts = True xlApp.AskToUpdateLinks = True xlApp.Visible = True xlSheet.Visible = xlSheetVisible End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening worksheet | Excel Discussion (Misc queries) | |||
opening worksheet | Excel Discussion (Misc queries) | |||
Opening a worksheet | Excel Discussion (Misc queries) | |||
VBA Opening worksheet, name changes | Excel Discussion (Misc queries) | |||
Opening a worksheet in VBA | Excel Programming |