Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
What does a File open like this Q
I have a file that when opened (I normally open via Windows Explorer)
reverts the screen via back to Windows Explorer. Why is that? I have tried to place the Sheet name within the code that I want it to start the view from (front Page), but it makes no difference Option Explicit Sub Auto_Open() Application.ScreenUpdating = False Application.WindowState = xlMinimized Dim OLKApp As Outlook.Application Dim WeStartedIt As Boolean On Error Resume Next Set OLKApp = GetObject(, "Outlook.Application") On Error GoTo 0 If OLKApp Is Nothing Then Set OLKApp = CreateObject("Outlook.Application") If OLKApp Is Nothing Then ' can't create app ' error mesage then exit MsgBox "Can't Get Outlook" Exit Sub End If WeStartedIt = True Else WeStartedIt = False End If Sheets("Front Page").Activate Range("A1").Select Dim OkToCallMacro As Boolean OkToCallMacro = False Select Case Weekday(Date) Case vbMonday To vbFriday If Time = TimeSerial(8, 44, 0) _ And Time < TimeSerial(8, 46, 0) Then OkToCallMacro = True End If Case Is = vbSaturday, vbSunday If Time = TimeSerial(8, 44, 0) _ And Time < TimeSerial(8, 46, 0) Then OkToCallMacro = True End If End Select If OkToCallMacro Then Call Copy_Paste If Workbooks.Count = 1 Then 'only this workbook is open ThisWorkbook.Save 'close the application '(which will close thisworkbook) Application.Quit Else ThisWorkbook.Close savechanges:=True End If End If If WeStartedIt = True Then OLKApp.Quit End If End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
What does a File open like this Q
Sean,
Your second line: Application.WindowState = xlMinimized means that Excel is minimized. This means that you see Windows Explorer, since it was the last program you were in. hth, Doug "Sean" wrote in message ps.com... I have a file that when opened (I normally open via Windows Explorer) reverts the screen via back to Windows Explorer. Why is that? I have tried to place the Sheet name within the code that I want it to start the view from (front Page), but it makes no difference Option Explicit Sub Auto_Open() Application.ScreenUpdating = False Application.WindowState = xlMinimized Dim OLKApp As Outlook.Application Dim WeStartedIt As Boolean On Error Resume Next Set OLKApp = GetObject(, "Outlook.Application") On Error GoTo 0 If OLKApp Is Nothing Then Set OLKApp = CreateObject("Outlook.Application") If OLKApp Is Nothing Then ' can't create app ' error mesage then exit MsgBox "Can't Get Outlook" Exit Sub End If WeStartedIt = True Else WeStartedIt = False End If Sheets("Front Page").Activate Range("A1").Select Dim OkToCallMacro As Boolean OkToCallMacro = False Select Case Weekday(Date) Case vbMonday To vbFriday If Time = TimeSerial(8, 44, 0) _ And Time < TimeSerial(8, 46, 0) Then OkToCallMacro = True End If Case Is = vbSaturday, vbSunday If Time = TimeSerial(8, 44, 0) _ And Time < TimeSerial(8, 46, 0) Then OkToCallMacro = True End If End Select If OkToCallMacro Then Call Copy_Paste If Workbooks.Count = 1 Then 'only this workbook is open ThisWorkbook.Save 'close the application '(which will close thisworkbook) Application.Quit Else ThisWorkbook.Close savechanges:=True End If End If If WeStartedIt = True Then OLKApp.Quit End If End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
What does a File open like this Q
Of course! Thanks Doug
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to open a 82 KB XLSM file due to "Too many different cellformats" & "Converter failed to open the file." errors. | Excel Discussion (Misc queries) | |||
In Excel - Use Windows Explorer instead of File Open to open file | Excel Discussion (Misc queries) | |||
Open a file do a macro ( made) and open next succesive file | Excel Programming | |||
Open File or Switch Between Windows if File is Open | Excel Programming | |||
Open File or Switch Between Windows if File is Open | Excel Programming |