+ Reply to Thread
Results 1 to 3 of 3

Opening Excel issue

  1. #1
    Shawn G.
    Guest

    Opening Excel issue

    When I open Excel by dbl clicking a workbook, excel starts but no workbook, I
    then have to goto file open and then it will come up. It worked just fine
    before I ran this sub, Any way to fix this?????

    Sub StoreExcelSettings()

    Dim cbBar As CommandBar
    Dim sBarNames As String
    Dim objTemp As Object
    Dim wkbTemp As Workbook

    'Some properties require a workbook open, so create one
    If ActiveWorkbook Is Nothing Then Set wkbTemp = Workbooks.Add

    'Write a value to indicate that the settings have been stored.
    SaveSetting gsREG_APP, gsREG_XL_ENV, "Stored", "Yes"

    'Store the current Excel settings in the registry,
    'for safe crash-recovery
    With Application
    SaveSetting gsREG_APP, gsREG_XL_ENV, "DisplayStatusBar",
    CStr(.DisplayStatusBar)
    SaveSetting gsREG_APP, gsREG_XL_ENV, "DisplayFormulaBar",
    CStr(.DisplayFormulaBar)
    SaveSetting gsREG_APP, gsREG_XL_ENV, "Calculation", CStr(.Calculation)
    SaveSetting gsREG_APP, gsREG_XL_ENV, "IgnoreRemoteRequests",
    CStr(.IgnoreRemoteRequests)
    SaveSetting gsREG_APP, gsREG_XL_ENV, "Iteration", CStr(.Iteration)
    SaveSetting gsREG_APP, gsREG_XL_ENV, "MaxIterations",
    CStr(.MaxIterations)

    'Which commandbars are visible
    For Each cbBar In .CommandBars
    If cbBar.Visible Then sBarNames = sBarNames & "," & cbBar.Name
    Next
    SaveSetting gsREG_APP, gsREG_XL_ENV, "VisibleCommandBars", sBarNames

    'Special items for Excel 2000 and up
    If Val(.Version) >= 9 Then
    SaveSetting gsREG_APP, gsREG_XL_ENV, "ShowWindowsInTaskbar",
    CStr(.ShowWindowsInTaskbar)
    End If

    'Special items for Excel 2002 and up
    If Val(.Version) >= 10 Then
    Set objTemp = .CommandBars
    SaveSetting gsREG_APP, gsREG_XL_ENV, "DisableAskAQuestion",
    CStr(objTemp.DisableAskAQuestionDropdown)
    SaveSetting gsREG_APP, gsREG_XL_ENV, "AutoRecover",
    CStr(.AutoRecover.Enabled)
    End If
    End With

    If Not wkbTemp Is Nothing Then wkbTemp.Close False

    End Sub

  2. #2
    Dave Peterson
    Guest

    Re: Opening Excel issue

    First, I'd guess it was just a coincidence--not caused by the code you posted.
    But it could have been caused by the restoreexcelsettings sub that you didn't
    paste.

    This setting "IgnoreRemoteRequests" corresponds to:
    Tools|options|general|ignore other applications

    But since you're not changing it in this codem (you're only storing it in the
    registry), this code isn't the problem. (But who knows what happens in the
    other half of this code??)

    ====

    Sometimes one of these works when you're having trouble with double clicking on
    the file in windows explorer:

    Tools|Options|General|Ignore other applications (uncheck it)

    --- or ---

    Close Excel and
    Windows Start Button|Run
    excel /unregserver
    then
    Windows Start Button|Run
    excel /regserver

    The /unregserver & /regserver stuff resets the windows registry to excel's
    factory defaults.

    Shawn G. wrote:
    >
    > When I open Excel by dbl clicking a workbook, excel starts but no workbook, I
    > then have to goto file open and then it will come up. It worked just fine
    > before I ran this sub, Any way to fix this?????
    >
    > Sub StoreExcelSettings()
    >
    > Dim cbBar As CommandBar
    > Dim sBarNames As String
    > Dim objTemp As Object
    > Dim wkbTemp As Workbook
    >
    > 'Some properties require a workbook open, so create one
    > If ActiveWorkbook Is Nothing Then Set wkbTemp = Workbooks.Add
    >
    > 'Write a value to indicate that the settings have been stored.
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "Stored", "Yes"
    >
    > 'Store the current Excel settings in the registry,
    > 'for safe crash-recovery
    > With Application
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "DisplayStatusBar",
    > CStr(.DisplayStatusBar)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "DisplayFormulaBar",
    > CStr(.DisplayFormulaBar)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "Calculation", CStr(.Calculation)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "IgnoreRemoteRequests",
    > CStr(.IgnoreRemoteRequests)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "Iteration", CStr(.Iteration)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "MaxIterations",
    > CStr(.MaxIterations)
    >
    > 'Which commandbars are visible
    > For Each cbBar In .CommandBars
    > If cbBar.Visible Then sBarNames = sBarNames & "," & cbBar.Name
    > Next
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "VisibleCommandBars", sBarNames
    >
    > 'Special items for Excel 2000 and up
    > If Val(.Version) >= 9 Then
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "ShowWindowsInTaskbar",
    > CStr(.ShowWindowsInTaskbar)
    > End If
    >
    > 'Special items for Excel 2002 and up
    > If Val(.Version) >= 10 Then
    > Set objTemp = .CommandBars
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "DisableAskAQuestion",
    > CStr(objTemp.DisableAskAQuestionDropdown)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "AutoRecover",
    > CStr(.AutoRecover.Enabled)
    > End If
    > End With
    >
    > If Not wkbTemp Is Nothing Then wkbTemp.Close False
    >
    > End Sub


    --

    Dave Peterson

  3. #3
    Shawn G.
    Guest

    RE: Opening Excel issue

    Found the answer,

    Tools->Options->General uncheck Ingnore other Applications


    "Shawn G." wrote:

    > When I open Excel by dbl clicking a workbook, excel starts but no workbook, I
    > then have to goto file open and then it will come up. It worked just fine
    > before I ran this sub, Any way to fix this?????
    >
    > Sub StoreExcelSettings()
    >
    > Dim cbBar As CommandBar
    > Dim sBarNames As String
    > Dim objTemp As Object
    > Dim wkbTemp As Workbook
    >
    > 'Some properties require a workbook open, so create one
    > If ActiveWorkbook Is Nothing Then Set wkbTemp = Workbooks.Add
    >
    > 'Write a value to indicate that the settings have been stored.
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "Stored", "Yes"
    >
    > 'Store the current Excel settings in the registry,
    > 'for safe crash-recovery
    > With Application
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "DisplayStatusBar",
    > CStr(.DisplayStatusBar)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "DisplayFormulaBar",
    > CStr(.DisplayFormulaBar)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "Calculation", CStr(.Calculation)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "IgnoreRemoteRequests",
    > CStr(.IgnoreRemoteRequests)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "Iteration", CStr(.Iteration)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "MaxIterations",
    > CStr(.MaxIterations)
    >
    > 'Which commandbars are visible
    > For Each cbBar In .CommandBars
    > If cbBar.Visible Then sBarNames = sBarNames & "," & cbBar.Name
    > Next
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "VisibleCommandBars", sBarNames
    >
    > 'Special items for Excel 2000 and up
    > If Val(.Version) >= 9 Then
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "ShowWindowsInTaskbar",
    > CStr(.ShowWindowsInTaskbar)
    > End If
    >
    > 'Special items for Excel 2002 and up
    > If Val(.Version) >= 10 Then
    > Set objTemp = .CommandBars
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "DisableAskAQuestion",
    > CStr(objTemp.DisableAskAQuestionDropdown)
    > SaveSetting gsREG_APP, gsREG_XL_ENV, "AutoRecover",
    > CStr(.AutoRecover.Enabled)
    > End If
    > End With
    >
    > If Not wkbTemp Is Nothing Then wkbTemp.Close False
    >
    > End Sub


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1