Terima kasih Ms. STDEV(i) atas pencerahannya
Jazakumulloh




________________________________
Dari: STDEV(i) <[email protected]>
Kepada: [email protected]
Terkirim: Rab, 8 Juni, 2011 17:07:43
Judul: Re: [belajar-excel] Perintah Macro untuk memilih "OK" atau "Batal"

  
munculnya Alert spt itu sebenarnya (dlm keadaan umum) untuk mengamankan kita
misalnya menimpa file penting, menutup workbook yg baru diedit (walaupun 
setitik)
tanpa men Save dst.

Tetapi bila hal itu sudah kita duga/ketahui kelanjutannya dengan pasti,  alert 
itu dapat 
kita hilangkan; kita suruh diam saja duduk manis tak perlu muncul kepermukaan 
 dengan 
mengeset  status displayAlert menjadi = false
setelah selesai keperluan langsung di set lagi ke TRUE


Pada help nya ada sedikit penjelasan spt ini

==========================================
Excel Developer Reference

Application.DisplayAlerts Property
True if Microsoft Excel displays certain alerts and messages while a macro is 
running. Read/write Boolean.

Syntax
expression.DisplayAlerts

expression   A variable that represents an Application object.

Remarks

The default value is True. Set this property to False if you don’t want to be 
disturbed by prompts and alert messages while a macro is running; any time a 
message requires a response, Microsoft Excel chooses the default response.

If you set this property to False, Micorosoft Excel sets this property to True 
when the code is finished, unless you are running cross process code.

When using the SaveAs method for workbooks to overwrite an existing file, the 
'Overwrite' alert has a default of 'No', while the 'Yes' response is selected 
by 
Excel when the DisplayAlerts property is set equal to False.

Example

This example closes the workbook Book1.xls and doesn’t prompt the user to save 
changes. Any changes to Book1.xls aren’t saved.

Visual Basic for Applications

Application.DisplayAlerts = False
Workbooks("BOOK1.XLS").Close
Application.DisplayAlerts = True

This example suppresses the message that otherwise appears when you initiate a 
DDE channel to an application that’s not running.

Visual Basic for Applications

Application.DisplayAlerts = False
channelNumber = Application.DDEInitiate( _
app:="WinWord", _
topic:="C:\WINWORD\FORMLETR.DOC")
Application.DisplayAlerts = True
Application.DDEExecute channelNumber, "[FILEPRINT]"
Application.DDETerminate channelNumber
Application.DisplayAlerts = True
==========================================




2011/6/8 Hendro Supardi <[email protected]>

Saya mengakalinya dengan kill terlebih dahulu file tersebut, baru save dengan 
nama file itu lagi di tempat yang sama. Terima kasih atas solusinya.
>Pada perintah macro yang lain juga ada yang muncul msgbox pilihan "Yes" or 
>"No", 
>karena tidak terlalu banyak, jika muncul msgbox tersebut maka dilakukan enter 
>secara manual. Apakah bisa menggunakan perintah SendKeys atau menggunakan 
>YaGituDehJuga?
>Mohon pencerahannya.
>Terima kasih,
>Hendro
>
>________________________________Dari: STDEV(i) <[email protected]>
>Kepada: [email protected]
>Terkirim: Rab, 8 Juni, 2011 14:34:37
>Judul: Re: [belajar-excel] Perintah Macro untuk memilih "OK" atau "Batal"
>
>kalau yang dikehendaki : OK
>
>(tetap disave dengan akibat mereplaced file yg sudah ada (path dan namanya 
sama)
>munculnya msgbox dapat dicegah dengan perintah (sebelum saveas) 
Sub YaGituDeh()
>   Application.DisplayAlerts = False
>   Workbooks("namafile").SaveAs Filename:="NamaFileBaru"
>   Application.DisplayAlerts = True
>End Sub
>
 

Kirim email ke