Saturday, January 04, 2014

VB function : Clean Up / Remove HTML XML code from String

This function is removing all HTML/XML code from some string.
Private Function CodeClean(ByVal DStr As String) As String
Dim i As Long, j As Long
Dim Chr1 As String, Chr2 As String
Dim FlBol As Boolean
  Chr1 = "<"
  Chr2 = ">"

  If InStr(DStr, Chr1) > 0 Then FlBol = True Else FlBol = False
 
  Do Until FlBol = False
    i = 0
    j = 0
    i = InStr(DStr, Chr1)
    j = InStr(DStr, Chr2)
    If i > 0 And j = 0 Then
      j = Len(DStr)
    End If
    DStr = Left(DStr, i - 1) & Right(DStr, Len(DStr) - j)
    If InStr(DStr, Chr1) > 0 Then FlBol = True Else FlBol = False
  Loop
  Code Clean = DStr
End Function

You may change variables Chr1 & Chr2 to fit your need.

Mie Goreng Jawa

http://www.eswete.com/resep-mie-goreng.html

Bahan-bahan:
1 bungkus mie telur kering atau secukupnya
100 gr udang, kupas
100 gr ayam suwir
5 buah bakso sapi, iris tipis
50 gr kol, iris tipis
3 batang caisim/sawi hijau, potong kecil
2 buah telur, kocok lepas
50 gr tauge atau secukupnya sesuai selera
1 buah tomat merah, potong beberapa bagian
2 sdm minyak goreng, untuk menumis
Bahan Bumbu Mie Goreng Jawa:
250 ml air kaldu ayam
1/2 sdt gula pasir
1/2 sdt garam
1 sdt merica bubuk
1 tangkai seledri, potong
1 sdm kecap manis
1 sdm kecap asin
2 batang daun bawang, iris miring
Bumbu yang Dihaluskan:
5 siung bawang merah, goreng
4 siung bawang putih
15 gr ebi, goreng
3 butir kemiri, sangrai

Cara Membuat Mie Goreng Jawa:
  • Rebus mie telur sampai matang lalu angkat dan campur bersama kecap manis dan kecap asin, kemudian aduk hingga rata. Sisihkan.
  • Siapkan wajan dan panaskan minyak, lalu tumis bumbu yang dihaluskan hingga tercium aroma harum.
  • Masukkan telur, orak-arik lalu sisihkan di pinggir wajan.
  • Masukkan suwiran ayam, udang dan bakso sapi. Aduk hingga setengah matang. Lalu masukkan tomat, tauge, kol dan caisim. Masak kembali semua adonan diatas wajan hingga layu.
  • Tuang sedikit kecap asin dan kecap manis, lalu garam, gula pasir dan merica bubuk. Aduk-aduk sambil diberi air kaldu ayam. Masak hingga meresap dan sayurannya matang.
  • Terakhir masukkan mie telur rebus lalu aduk bersama semua bahan sambil ditambahkan daun bawang dan seledri. Aduk hingga semua matang merata.
  • Angkat mie goreng Jawa dan sajikan bersama taburan bawang goreng dan seledri, sesuai selera.
Catatan Sendiri : Kemiri di sangrai sebelum di haluskan. Hal ini sering di anggap remeh. Ternyata pas saya coba, hasil mie gorengnya berasa kurang mantab. Berasa seperti ada bumbu yang mentah. Kemungkinan besar dari kemiri yang belum matang.

Saturday, December 28, 2013

Crack Hacking Password Microsoft Excel Macro VBA Project

There is another (somewhat easier) solution, without the size problems. I used this approach today (on a 2003 XLS file, using Excel 2007) and was successful.

  1.     Backup the xls file
  2.     Using a HEX editor, locate the DPB=... part
  3.     Change the DPB=... string to DPx=...
  4.     Open the xls file in Excel
  5.     Open the VBA editor (ALT+F11)
  6.     the magic: Excel discovers an invalid key (DPx) and asks whether you want to continue loading the project (basically ignoring the protection)
  7.     You will be able to overwrite the password, so change it to something you can remember
  8.     Save the xls file*
  9.     Close and reopen the document and work your VBA magic!

*NOTE: Be sure that you have changed the password to a new value, otherwise the next time you open the spreadsheet Excel will report errors (Unexpected Error), then when you access the list of VBA modules you will now see the names of the source modules but receive another error when trying to open forms/code/etc. To remedy this, go back to the VBA Project Properties and set the password to a new value. Save and re-open the Excel document and you should be good to go!

http://stackoverflow.com/questions/1026483/is-there-a-way-to-crack-the-password-on-an-excel-vba-project

My personal Note : Those methods written above is not applicable for .xlsm file. The easiest way is "save as" the file into old version .xls file. After that follow the methods above.