Solved

Excel workbookbeforesave event in vb.net

Posted on 2011-03-08
3
523 Views
Last Modified: 2012-05-11
from vb.net, When I close an excel , WorkbookBeforeClose event gets fired and then , Dialog box gets appeared with a question as Do you want to save the changes to 'Book1'? and  with Yes, no Cancel buttons.

On Yes press, I want to fire workbookBeforeSave event from vb.net. How do I do that??

Please, help me out.

0
Comment
Question by:gopalhazel
[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 10

Accepted Solution

by:
kdwood earned 500 total points
ID: 35069184
Greetings gopalhazel,

Please take a look at the following Microsoft link.   Once you get into it, post your code if you get stuck and I'm sure we can help.

http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q302814

Regards,

Keith
0
 

Author Comment

by:gopalhazel
ID: 35091854
Dear Keith,

on closing excel, cursor goes to the event named workbook beforeclose.

afterwhich excel askes a question as "do you want to save changes in 'Book1'", with buttons yes,no and cancel.

my problem is, on yes press, cursor should goto workbookbeforesave event, but that is not happening.

so my question is how to control on when user presses on Yes button to save the Book1 and then i want to divert my control to workbookbeforesave event.
As in my case cursor properly goes to workbookbeforeclose event but after pressing yes to save the 'Book1' cursor does not go 'workbookbeforesave event and it directly throws save dialogbox.

Please help me out, its urgent.



0
 
LVL 10

Expert Comment

by:kdwood
ID: 35110886

Please post your code, so we can try to help.
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 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