Consulting

Results 1 to 5 of 5

Thread: Excel screen stretching

  1. #1
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location

    Excel screen stretching

    I have a problem with a workbook I produced. It was crated in the English (UK) version of Excel. However, my Mexican and German colleagues both report screen stretching (i.e. the workbook expands and does not fit on the screen). Other workbooks I sent them are fine.

    Does anybody have any idea what this might be?

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Any code in the workbook? In the thisworkbook module or any of the sheet modules?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location
    Yes. Lots. I'm wondering if it might be something to do with one of these commands:


    [VBA]
    Application.CommandBars.FindControl(ID:=30003).Delete
    Application.CommandBars.FindControl(ID:=30004).Delete
    Application.CommandBars.FindControl(ID:=30005).Delete
    Application.CommandBars.FindControl(ID:=30006).Delete
    Application.CommandBars.FindControl(ID:=30007).Delete
    Application.CommandBars.FindControl(ID:=30011).Delete
    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    ActiveWindow.DisplayHeadings = False
    ActiveWindow.DisplayWorkbookTabs = False
    Application.DisplayAlerts = False
    [/VBA]

    Edit: VBA tags added to code.

  4. #4
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Are they in the thisworkbook module and are there more commands? I don't see any there that would cause your problem.

    Post the workbook open code.

    Hint, when posting code, select the code and hit the green vba button to format it for the forum as I have done to your code in post #3
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  5. #5
    VBAX Regular
    Joined
    Feb 2010
    Posts
    32
    Location
    Well, this is a cut and paste from the thisworkbook module:

    [VBA]
    Dim close_flag As Boolean

    Private Sub Workbook_Activate()
    Call menu_create
    Call unprotect_sheet
    Call hide_everything
    Call show_everything
    Application.ScreenUpdating = False
    Call excel_version
    Call protect_sheet
    End Sub

    Private Sub Workbook_BeforeClose(Cancel As Boolean)

    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    ActiveWindow.DisplayWorkbookTabs = False
    ActiveWindow.DisplayHeadings = False
    close_flag = True
    Application.ScreenUpdating = False
    End Sub

    Private Sub Workbook_Deactivate()
    If close_flag = True Then
    menu_delete
    Else
    menu_delete
    Call show_everything
    Application.ScreenUpdating = True
    End If
    End Sub

    Private Sub Workbook_Open()
    close_flag = False
    Worksheets("Top").Activate
    Call unprotect_sheet
    'Call menu_create
    Range("A1").Select
    Call protect_sheet
    Application.ScreenUpdating = False
    Call excel_version
    End Sub

    Private Sub Workbook_SheetActivate(ByVal Sh As Object)

    If activate_flag <> True Then
    Call unprotect_sheet
    ActiveWindow.DisplayHeadings = False
    Call protect_sheet
    ActiveWindow.DisplayWorkbookTabs = False
    ActiveWindow.DisplayHeadings = False

    End If
    End Sub

    Public Sub hide_everything()

    'disable these before finishing
    Application.AutoRecover.Enabled = False
    Application.CommandBars("Borders").Visible = False
    Application.CommandBars("Standard").Visible = False
    Application.CommandBars("Formatting").Visible = False
    Application.CommandBars("Control Toolbox").Visible = False
    Application.CommandBars("Drawing").Visible = False
    ' Application.CommandBars(1).Controls("edit").Delete
    ' Application.CommandBars(1).Controls("view").Delete
    ' Application.CommandBars(1).Controls("insert").Delete
    ' Application.CommandBars(1).Controls("format").Delete
    ' Application.CommandBars(1).Controls("tools").Delete
    ' Application.CommandBars(1).Controls("data").Delete
    Application.CommandBars.FindControl(ID:=30003).Delete
    Application.CommandBars.FindControl(ID:=30004).Delete
    Application.CommandBars.FindControl(ID:=30005).Delete
    Application.CommandBars.FindControl(ID:=30006).Delete
    Application.CommandBars.FindControl(ID:=30007).Delete
    Application.CommandBars.FindControl(ID:=30011).Delete
    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    ActiveWindow.DisplayHeadings = False
    ActiveWindow.DisplayWorkbookTabs = False
    Application.DisplayAlerts = False
    'ActiveWorkbook.Close True ' closes the active workbook and saves any changes
    End Sub

    Public Sub show_everything()
    Application.AutoRecover.Enabled = True
    'Application.CommandBars("Borders").Visible = True
    Application.CommandBars("Standard").Visible = True
    Application.CommandBars("Formatting").Visible = True
    Application.CommandBars("Control Toolbox").Visible = True
    Application.CommandBars(1).Reset
    Application.DisplayFormulaBar = True
    Application.DisplayStatusBar = True
    ActiveWindow.DisplayHeadings = True
    ActiveWindow.DisplayWorkbookTabs = True
    'Call menu_create

    End Sub

    Public Sub excel_version()

    Dim oApp As Object
    Dim sVersion As String
    Set oApp = GetObject(, "Excel.Application")
    If TypeName(oApp) = "Nothing" Then
    Set oApp = CreateObject("Excel.Application")
    End If
    Select Case Left$(oApp.Version, InStr(1, oApp.Version, ".") + 1)
    Case "8.0"
    sVersion = "97"
    MsgBox "Excel version too old. You need 2003 or newer"
    Workbooks("CCalc_PVC").Close
    Case "9.0"
    sVersion = "2000"
    MsgBox "Excel version too old. You need 2003 or newer"
    Workbooks("CCalc_PVC").Close
    Case "10.0"
    sVersion = "2002"
    MsgBox "Excel version too old. You need 2003 or newer"
    Workbooks("CCalc_PVC").Close
    Case "11.0"
    sVersion = "2003"
    'MsgBox "Excel version: " & sVersion
    Case "12.0"
    sVersion = "2007"
    'MsgBox "Excel version: " & sVersion
    Call v_2007_updates
    Case Else
    sVersion = "Too Old!"
    MsgBox "Excel version: " & sVersion & " the code will not work in this version"
    Workbooks("CCalc_PVC").Close
    End Select

    End Sub

    Public Sub v_2007_updates()

    End Sub
    [/VBA]

Posting Permissions

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