Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Closing VBA editior programmatically

I have a macro which ends like this:

With ActiveWorkbook.VBProject.VBComponents("ThisWorkboo k").CodeModule
StartLine = .CreateEventProc("BeforeClose", "Workbook") + 1
.InsertLines StartLine, _
"Msgbox ""Blahblahblahblah...."",vbOkOnly"
End With

When I run the macro, it does whatever it has to do and then ends by
displaying the code module window with the above code. This will
puzzle my friends who will run the macro since they don't know a thing
about VBA. How can I close the VBA editor programmatically?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Closing VBA editior programmatically

SendKeys "%{F4}", Tru

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Closing VBA editior programmatically

I see. Pretty clever!

BrianB wrote in message ...
SendKeys "%{F4}", True


---
Message posted from http://www.ExcelForum.com/

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing workbooks w/o closing Excel Barb in MD Excel Discussion (Misc queries) 3 February 15th 10 06:42 PM
Visual basic editior Stan Halls Excel Worksheet Functions 3 September 14th 07 12:24 PM
Can I add equation editior to my toolbar in EXCel as an icon? happy Excel Worksheet Functions 1 October 16th 05 05:32 PM
closing excel after closing a workbook CWalsh[_2_] Excel Programming 3 January 21st 04 03:33 PM
Programmatically Add Reference` keepitcool Excel Programming 1 September 16th 03 05:30 PM


All times are GMT +1. The time now is 09:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"