Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear All,
I create a new excel workbook from a template by using Selection.PasteSpecial so the code in the template is not copied. But i want some new code in the new workbook! Is it possible to insert code ( workbook_Before_close) in the new workbook. Filip |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
siehe: http://www.cpearson.com/excel/vbe.htm -- Regards Frank Kabel Frankfurt, Germany "Filips Benoit" schrieb im Newsbeitrag ... Dear All, I create a new excel workbook from a template by using Selection.PasteSpecial so the code in the template is not copied. But i want some new code in the new workbook! Is it possible to insert code ( workbook_Before_close) in the new workbook. Filip |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim StartLine As Long
With ActiveWorkbook.VBProject.VBComponents("ThisWorkboo k").CodeModule StartLine = .CreateEventProc("BeforeClose", "Workbook") + 1 .InsertLines StartLine, _ "Dim ans" & vbCrLf & _ " ans = Msgbox( ""All OK"",vbOYesNo)" & vbCrLf & _ " If ans = vbNo Then Cancel = True" End With -- HTH RP "Filips Benoit" wrote in message ... Dear All, I create a new excel workbook from a template by using Selection.PasteSpecial so the code in the template is not copied. But i want some new code in the new workbook! Is it possible to insert code ( workbook_Before_close) in the new workbook. Filip |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert Code | Excel Worksheet Functions | |||
How to insert code | Excel Discussion (Misc queries) | |||
Insert Code | New Users to Excel | |||
code to insert add'l code ??? | Excel Programming | |||
Insert into existing code | Excel Programming |