Consulting

Results 1 to 3 of 3

Thread: Need to preventt xlsm file from being converted to xls

  1. #1
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location

    Need to preventt xlsm file from being converted to xls

    I need users that attempt to open my 2007 .xlsm workbook in 2003 to get a msgbox and have it close before the 2007-to-2003-converter-utility has a chance to run.

    And if possible it would be great if I could have the before save event in 2007 prevent conversion that way as well.

    Thanks

  2. #2
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    my thread was about "only open the file in excel 2003".

    below is what "pascal" provided.

    [vba]
    Private Sub Workbook_Open()
    If Not Application.Version <> "11.0" Then
    MsgBox "Please only open this file in Excel 2003"
    ThisWorkbook.Close
    End If
    End Sub
    [/vba]

    so perhaps...(goes to ThisWorkbook)
    not tested. try with a backup pls.

    [vba]
    Private Sub Workbook_Open()
    If Application.Version <> "12.0" Then
    MsgBox "Please only open this file in Excel 2007"
    ThisWorkbook.Close
    End If
    End Sub
    [/vba]
    Last edited by mancubus; 02-17-2011 at 01:58 AM.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

  3. #3
    VBAX Guru mancubus's Avatar
    Joined
    Dec 2010
    Location
    "Where I lay my head is home" :D
    Posts
    2,644
    i must add....

    you have to force users enable macros, (if don't know how, check:
    http://www.vbaexpress.com/kb/getarticle.php?kb_id=379 )

    and password protect your vba project.
    PLS DO NOT PM; OPEN A THREAD INSTEAD!!!

    1) Posting Code
    [CODE]PasteYourCodeHere[/CODE]
    (or paste your code, select it, click # button)

    2) Uploading File(s)
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.

    3) Testing the Codes
    always back up your files before testing the codes.

    4) Marking the Thread as Solved
    from Thread Tools (on the top right corner, above the first message)

Posting Permissions

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