[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using Excel

Posted on 1998-09-30
3
Medium Priority
?
168 Views
Last Modified: 2010-04-30
I am using Excel book as a object in VB program.

This is how I decalred

Dim WithEvents xlApp As Excel.Application
Dim WithEvents xlSheet As Excel.Worksheet
Dim WithEvents xlBook As Excel.Workbook

and I am opening the file through get object

 Set xlBook = GetObject(path)
   
    xlBook.Application.Visible = True
    xlBook.Windows(1).Visible = True
   Set xlSheet = xlBook.ActiveSheet

When the user tries to close the file from excel I have to popup a form which asks whether the user want to save it or not, so I am trapping the before close event

Private Sub xlBook_BeforeClose(Cancel As Boolean)
form to be displayed
End Sub

after this event I have to return to excel, but the problem is then excel is throwing it's dialog box askinh whether the user want to save with YES,NO,CANCEL options. I don't want it to be dispalyed. SO how can I send a Cancel message to excel before coming out of the before close function. No matter what the user opted in my form.
0
Comment
Question by:lesa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
fguerreiro_inix earned 40 total points
ID: 1437350
Use

Application.ActiveWorkbook.Saved = True

and you won't be promped



Regards
0
 
LVL 3

Expert Comment

by:fguerreiro_inix
ID: 1437351
Application.ActiveWorkbook.Saved = True

This don't save the workbook.
Just prevent from getting the message
0
 

Author Comment

by:lesa
ID: 1437352
Sorry for the delay
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question