+ Reply to Thread
Results 1 to 2 of 2

XP macros not working in NT

  1. #1
    DKS
    Guest

    XP macros not working in NT

    I have few .xls with macros written and tested on XP based Excel. However,
    the same .xls when used on NT based Excel generate a Dr. Watson. All the
    macro statements are perfectly compatible with NT version, no fancy features
    used.

    Any idea on what could be the potential cause of the error? To help you
    zoom in the problem I have reproduced one of the many macros that generate a
    Dr. Watson on NT machines.

    Thanks a lot for your help.

    Sub Select_View()
    '
    ' Select_View Macro
    ' Based on user selection, a filter in column of business view is activated.
    ' This column is a hidden column, thus first step is to unhide the column.
    ' Next step is to apply approrpriate filter criteria
    ' Last step is to re-hide the column
    '

    '
    r = MsgBox("Do you want only Business View? (Yes = Only Business view,
    No = Entire view)", vbYesNo, "Select View")
    Selection.AutoFilter Field:=4, Criteria1:="<>"
    Range("A1").Select
    ActiveSheet.ShowAllData
    ActiveCell.Select
    If r = vbYes Then
    ActiveCell.Offset(0, 16).Columns("A:C").EntireColumn.Select
    Selection.EntireColumn.Hidden = False
    Selection.AutoFilter Field:=17, Criteria1:="Yes"
    Range("A1").Select
    ActiveCell.Offset(0, 16).Columns("A").EntireColumn.Select
    Selection.EntireColumn.Hidden = True
    Range("A1").Select
    Else
    If r = vbNo Then
    Range("A1").Select
    Else
    r = MsgBox("error in reply", vbOKCancel, "msg")
    End If
    End If
    ActiveWindow.Visible = True
    End Sub

  2. #2
    NickHK
    Guest

    Re: XP macros not working in NT

    Are they all running the same version of XL ?
    If not, you should design you code on the oldest system you intend to
    support.

    However, whilst there may be something in you code to produce a run-time
    error in Excel, I don't see anything to crash Excel completely.
    So I feel the problem is elsewhere in your code, but it may depend on the
    version of Excel on the NT machines.

    NickHK

    "DKS" <[email protected]> wrote in message
    news:[email protected]...
    > I have few .xls with macros written and tested on XP based Excel.

    However,
    > the same .xls when used on NT based Excel generate a Dr. Watson. All the
    > macro statements are perfectly compatible with NT version, no fancy

    features
    > used.
    >
    > Any idea on what could be the potential cause of the error? To help you
    > zoom in the problem I have reproduced one of the many macros that generate

    a
    > Dr. Watson on NT machines.
    >
    > Thanks a lot for your help.
    >
    > Sub Select_View()
    > '
    > ' Select_View Macro
    > ' Based on user selection, a filter in column of business view is

    activated.
    > ' This column is a hidden column, thus first step is to unhide the column.
    > ' Next step is to apply approrpriate filter criteria
    > ' Last step is to re-hide the column
    > '
    >
    > '
    > r = MsgBox("Do you want only Business View? (Yes = Only Business view,
    > No = Entire view)", vbYesNo, "Select View")
    > Selection.AutoFilter Field:=4, Criteria1:="<>"
    > Range("A1").Select
    > ActiveSheet.ShowAllData
    > ActiveCell.Select
    > If r = vbYes Then
    > ActiveCell.Offset(0, 16).Columns("A:C").EntireColumn.Select
    > Selection.EntireColumn.Hidden = False
    > Selection.AutoFilter Field:=17, Criteria1:="Yes"
    > Range("A1").Select
    > ActiveCell.Offset(0, 16).Columns("A").EntireColumn.Select
    > Selection.EntireColumn.Hidden = True
    > Range("A1").Select
    > Else
    > If r = vbNo Then
    > Range("A1").Select
    > Else
    > r = MsgBox("error in reply", vbOKCancel, "msg")
    > End If
    > End If
    > ActiveWindow.Visible = True
    > 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