Results 1 to 4 of 4

Thread: Saving Excel workbook with VB6

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Posts
    20

    Post

    OK now, I'm almost there. I still can't seem to figure out why one of the Excels won't go away, but I think I'm on the right track now. Now the slight problem I'm having is that once I have saved a file, if I try to edit and resave it, a message box appears from Excel telling me there's already a file with that name and would I like to rename it. How do I make my program not show this message and just save the darn thing? I already know it's the same name.

  2. #2
    Member
    Join Date
    Jun 1999
    Posts
    44

    Post

    Hi!!

    All you need is one line of code:

    xlExcel.Application.DisplayAlerts = False

    xlExcel is your object and the rest of the line goes in just as you see it.
    Hope this helps!!

    Lloyd

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Posts
    20

    Post

    Does this go right in the beginning of the procedure or just before I do the save? Or does it really matter?

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jul 1999
    Posts
    20

    Post

    I did this at the beginning and the opposite at the end of my procedure. Now when I go to close the activeworkbook I am getting an "Object variable or with block not set" error. Here is the line it's catching on:

    MyExcel.ActiveWorkbook.Close True, sExcelFileName

Posting Permissions

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



Click Here to Expand Forum to Full Width