Ask Experts Questions for FREE Help !
Ask
    kvinay_00's Avatar
    kvinay_00 Posts: 36, Reputation: 1
    Junior Member
     
    #1

    Jul 17, 2009, 03:48 AM
    Macro does not work after converting to .exe
    I am using below macro in a sheet and wants to convert the sheet to .exe format by using a XLTOEXE program.

    Macro works perfectly in normal .xls sheet. However, it does not work correctly in the converted file (converted to .exe). It gives the message as per the macro message box but still opens the Save As box.

    Can somebody help?

    I have put it in THISWORKBOOK.

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    If SaveAsUI = True Then

    MsgBox "Use Save option"
    Cancel = True

    End If

    End Sub


    Thanks

    Vinay
    JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #2

    Jul 17, 2009, 10:58 AM

    Of course other may respond, but if you're having a specific problem using a specific program, perhaps giving us the exact full name and publisher of the program you're having difficulty with at least gives us a chance to help you research an answer.

    Meanwhile, I would suggest you start at that publisher's own support site or Google search by the program first, then your issue. Like this:

    Google Search: "XLSTOEXE Save doesn't work"
    ... or something similar.

    Q: You ARE using SAVE and not SAVEAS, right?
    kvinay_00's Avatar
    kvinay_00 Posts: 36, Reputation: 1
    Junior Member
     
    #3

    Jul 17, 2009, 08:31 PM
    I am attaching original .xls file which I am using. I am unable to attach the converted .exe file.

    Below is the link of the program I have used to convert .xls to .exe -

    Converter from XL to EXE - Convert Microsoft Excel Files to Executable Files

    Thanks

    Vinay
    Attached Files
  1. File Type: xls Price calculations Africa.xls (19.0 KB, 152 views)
  2. JBeaucaire's Avatar
    JBeaucaire Posts: 5,426, Reputation: 997
    Software Expert
     
    #4

    Jul 17, 2009, 11:32 PM

    Open up your ThisWorkbook module, clear it out and put this in there instead:

    Code:
    Private Sub Workbook_Open()
        Application.CommandBars("File").Controls(5).Enabled = False
    End Sub
    
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
        Application.CommandBars("File").Controls(5).Enabled = True
    End Sub
    
    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        If SaveAsUI = True Then
            MsgBox "SaveAs not allowed.  Changes saved...workbook closing."
            ThisWorkbook.Close True
        End If
    End Sub
    This will not only disable the SaveAs button on the FILE menu, if someone is savvy enough to know about F12, pressing it will cause their sheet to be saved and the workbook closed before the SaveAs window has a chance to open.

    Best I can think of. This does work with your XLtoEXE program.
    kvinay_00's Avatar
    kvinay_00 Posts: 36, Reputation: 1
    Junior Member
     
    #5

    Jul 18, 2009, 03:58 AM
    Great!

    Thanks JB

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Excel Macro [ 13 Answers ]

I have some code that loops through a row and a column and compares data. When it finds the values being equal it copies the columns the row is in and pastes it on another sheet along with the previous value of the column. For Each CCell In Range("C2:C65418") If Not IsEmpty(CCell.Value)...

Macro help [ 3 Answers ]

Hi all, I am currently working with a dataset where the data in column A is empty until a user enters a rank (i.e. like ranking grades in ascending order). Currently the macro takes the number and moves the row entry to the top by assuming that the rank is to be the highest rank (it then takes...

If statement macro [ 10 Answers ]

Hello , I have an excel macro to take data from one spreadsheet and format in a partciular method. Now I want to add an if statement like I have an excel formula that works but I need it put into the macro. The formula is: if(AA21="USD", "6YB", "6YA") Help Thanks

Macro system [ 2 Answers ]

:confused: what do you think is the most significant macro system in today's family life. (church, Social agencies, health care program, etc)


View more questions Search