Announcement

Collapse
No announcement yet.

Excel save sheet as shows msgbox

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Excel save sheet as shows msgbox

    I have this sheet object and want to make a copy.
    In this case to csv.
    If the file exists if asks for overwrite (excel is hidden) so i delete the file before the save..

    But it keeps asking if i want to save the changes in the txt (csv) file!
    I just saved it??
    hellobasic

  • #2
    I've had the exact same problem with three different versions of Excel. I think it occurs whenever you want to do anything other than use what Excel thinks the "proper" file extension is, even if you are saving the file using the same name+extension you just opened it with.

    I think it's something congenital.
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Try doing:
      Code:
      vSaved = 1
      OBJECT LET oExcelWorkBook.Saved = vSaved
      Just a guess, have not tried it.
      Sincerely,

      Steve Rossell
      PowerBASIC Staff

      Comment


      • #4
        On workbook load i already set this.
        the wb is a different object, the worksheet is used for saveas() but does not seem to have this option.

        But then, i am looking for that
        hellobasic

        Comment


        • #5
          Maybe this option works the same as the User's SaveAs and may be it uses the target file after save.

          I just need a copy and the original sheet properties should not apply to this copy.

          I can do it myself but there are neat export filetypes which are hard to make yourself.
          The CSV is just an example.
          hellobasic

          Comment


          • #6
            I agree with MCM its been a major annoyance in every version of Excel I have ever used. If you do a Save As CSV then close Excel even if you don't touch a single element it will come back with the same message box again and if you give the same answers as you did before it will then come back with another message box asking if you want to overwrite the file it created before you closed, such is M$ programming.

            Comment


            • #7
              Don't know if this will work but try closing Excel with a value of 2 in the first optional position of
              MEMBER CALL CLOSE<&H00000115>(OPTIONAL IN SaveChanges AS VARIANT<&H00000000>, OPTIONAL IN Filename AS VARIANT<&H00000001>, OPTIONAL IN RouteWorkbook AS VARIANT<&H00000002>) AS LONG

              Comment


              • #8
                John,

                Try turning off the DisplayAlerts property for the Excel object before you save.

                In VB I did it this way:

                Code:
                oEXCEL.DisplayAlerts = False
                One of the problems I had in VB was the alert message box was not the top most message box and sometimes appeared behind Excel and any other app I happened to have running at the time, giving the impression my app was hanging when in reality Excel was just waiting for the alert message box to be acknowledged. You're right it is annoying.

                Maybe M$ fixed this in Excel 2007.

                HTH
                Later...

                JR

                "When governments fear the people there is liberty. When people fear the government there is tyranny." - Thomas Jefferson

                Comment

                Working...
                X