Create Interactive Tour

Windows Analysis Report
SecuriteInfo.com.Script.SNH-gen.9465.5598.xls

Overview

General Information

Sample Name:SecuriteInfo.com.Script.SNH-gen.9465.5598.xls
Analysis ID:753390
MD5:f12ff8c249bb5fa66bf7456dbd24d2f4
SHA1:a95cb2684dc78798816008833da88f9e09031690
SHA256:d89593a50b26663b82f9720ffaa24ba6c91216266c582333e469f9c48f6e2199
Tags:xls
Errors
  • Corrupt sample or wrongly selected analyzer.

Detection

Score:76
Range:0 - 100
Whitelisted:false
Confidence:100%

Signatures

Multi AV Scanner detection for submitted file
Document contains an embedded VBA with functions possibly related to ADO stream file operations
Document contains VBA stomped code (only p-code) potentially bypassing AV detection
Document contains an embedded VBA with many string operations indicating source code obfuscation
Document contains an embedded VBA macro which may execute processes
Document contains an embedded VBA macro with suspicious strings
Document contains an embedded VBA with functions possibly related to HTTP operations
Document contains an embedded VBA with hexadecimal encoded strings
Document contains an embedded VBA macro which executes code when the document is opened / closed
Document contains embedded VBA macros
Document misses a certain OLE stream usually present in this Microsoft Office document type

Classification

RansomwareSpreadingPhishingBankerTrojan / BotAdwareSpywareExploiterEvaderMinercleansuspiciousmalicious
  • System is w7x64
  • EXCEL.EXE (PID: 2996 cmdline: "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" /automation -Embedding MD5: D53B85E21886D2AF9815C377537BCAC3)
  • cleanup
No configs have been found
No yara matches
No Sigma rule has matched
No Snort rule has matched

Click to jump to signature section

Show All Signature Results

AV Detection

barindex
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsVirustotal: Detection: 22%Perma Link
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsReversingLabs: Detection: 12%
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEFile opened: C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_08e4299fa83d7e3c\MSVCR90.dllJump to behavior
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsString found in binary or memory: http://www.motobit.com/help/scptutl/sa2
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsString found in binary or memory: http://www.motobit.com/help/scptutl/sa298.htm
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsString found in binary or memory: http://www.w3.
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsString found in binary or memory: http://www.w3.oHrg/

System Summary

barindex
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsStream path 'VBA/PaczkiPlacowe' : found possibly 'ADODB.Stream' functions open, read, write
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsStream path 'VBA/PaczkiZwykle' : found possibly 'ADODB.Stream' functions mode, position, loadfromfile, open, read, savetofile, write, writetext
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: ID = Shell(program, vbNormalFocus)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: 'Shell "notepad.exe", vbNormalFocus ' Open Notepad
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: 'ID = Shell(program, vbNormalFocus)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Set f = fs.CreateTextFile(fname, True)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Set f = fs.CreateTextFile(fname, True)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Set f = fs.CreateTextFile(fname, True)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Set f_mt103 = fs_mt103.CreateTextFile(fname_MT103, True)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Set f_xml = fs_xml.CreateTextFile(fname_XML, True, unicode)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: 'Set f2_xml = fs2_xml.CreateTextFile(fname2_XML, True)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsStream path 'VBA/PaczkiZwykle' : found possibly 'XMLHttpRequest' functions status, open, send
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsStream path 'VBA/PaczkiZwykle' : found hex strings
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Sub Workbook_Open()
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE, VBA macro line: Private Sub Workbook_BeforeClose(Cancel As Boolean)
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE indicator, VBA macros: true
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE stream indicators for Word, Excel, PowerPoint, and Visio: all false
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsVirustotal: Detection: 22%
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsReversingLabs: Detection: 12%
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEFile created: C:\Users\user\AppData\Local\Temp\CVR6289.tmpJump to behavior
Source: classification engineClassification label: mal76.expl.evad.winXLS@1/1@0/0
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEFile read: C:\Users\desktop.iniJump to behavior
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEKey opened: HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Resiliency\StartupItemsJump to behavior
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEFile opened: C:\Windows\WinSxS\amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_08e4299fa83d7e3c\MSVCR90.dllJump to behavior

Data Obfuscation

barindex
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsStream path 'VBA/PaczkiPlacowe' : High number of string operations
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsStream path 'VBA/PaczkiZwykle' : High number of string operations
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior
Source: C:\Program Files\Microsoft Office\Office14\EXCEL.EXEProcess information set: NOOPENFILEERRORBOXJump to behavior

HIPS / PFW / Operating System Protection Evasion

barindex
Source: SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsOLE indicator, VBA stomping: true
Initial AccessExecutionPersistencePrivilege EscalationDefense EvasionCredential AccessDiscoveryLateral MovementCollectionExfiltrationCommand and ControlNetwork EffectsRemote Service EffectsImpact
Valid Accounts62
Scripting
Path InterceptionPath Interception62
Scripting
OS Credential Dumping1
File and Directory Discovery
Remote ServicesData from Local SystemExfiltration Over Other Network Medium1
Application Layer Protocol
Eavesdrop on Insecure Network CommunicationRemotely Track Device Without AuthorizationModify System Partition
Default AccountsScheduled Task/JobBoot or Logon Initialization ScriptsBoot or Logon Initialization Scripts1
Obfuscated Files or Information
LSASS Memory1
System Information Discovery
Remote Desktop ProtocolData from Removable MediaExfiltration Over BluetoothJunk DataExploit SS7 to Redirect Phone Calls/SMSRemotely Wipe Data Without AuthorizationDevice Lockout
Domain AccountsAt (Linux)Logon Script (Windows)Logon Script (Windows)1
Obfuscated Files or Information
Security Account ManagerQuery RegistrySMB/Windows Admin SharesData from Network Shared DriveAutomated ExfiltrationSteganographyExploit SS7 to Track Device LocationObtain Device Cloud BackupsDelete Device Data
Hide Legend

Legend:

  • Process
  • Signature
  • Created File
  • DNS/IP Info
  • Is Dropped
  • Is Windows Process
  • Number of created Registry Values
  • Number of created Files
  • Visual Basic
  • Delphi
  • Java
  • .Net C# or VB.NET
  • C, C++ or other language
  • Is malicious
  • Internet
behaviorgraph top1 signatures2 2 Behavior Graph ID: 753390 Sample: SecuriteInfo.com.Script.SNH... Startdate: 24/11/2022 Architecture: WINDOWS Score: 76 7 Multi AV Scanner detection for submitted file 2->7 9 Document contains VBA stomped code (only p-code) potentially bypassing AV detection 2->9 11 Document contains an embedded VBA with hexadecimal encoded strings 2->11 13 5 other signatures 2->13 5 EXCEL.EXE 3 3 2->5         started        process3

This section contains all screenshots as thumbnails, including those not shown in the slideshow.


windows-stand
SourceDetectionScannerLabelLink
SecuriteInfo.com.Script.SNH-gen.9465.5598.xls22%VirustotalBrowse
SecuriteInfo.com.Script.SNH-gen.9465.5598.xls12%ReversingLabsScript-Macro.Trojan.Logan
No Antivirus matches
No Antivirus matches
No Antivirus matches
SourceDetectionScannerLabelLink
http://www.w3.oHrg/0%Avira URL Cloudsafe
No contacted domains info
NameSourceMaliciousAntivirus DetectionReputation
http://www.motobit.com/help/scptutl/sa2SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsfalse
    high
    http://www.w3.SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsfalse
      high
      http://www.motobit.com/help/scptutl/sa298.htmSecuriteInfo.com.Script.SNH-gen.9465.5598.xlsfalse
        high
        http://www.w3.oHrg/SecuriteInfo.com.Script.SNH-gen.9465.5598.xlsfalse
        • Avira URL Cloud: safe
        unknown
        No contacted IP infos
        Joe Sandbox Version:36.0.0 Rainbow Opal
        Analysis ID:753390
        Start date and time:2022-11-24 18:14:34 +01:00
        Joe Sandbox Product:CloudBasic
        Overall analysis duration:0h 4m 23s
        Hypervisor based Inspection enabled:false
        Report type:full
        Sample file name:SecuriteInfo.com.Script.SNH-gen.9465.5598.xls
        Cookbook file name:defaultwindowsofficecookbook.jbs
        Analysis system description:Windows 7 x64 SP1 with Office 2010 SP1 (IE 11, FF52, Chrome 57, Adobe Reader DC 15, Flash 25.0.0.127, Java 8 Update 121, .NET 4.6.2)
        Run name:Without Instrumentation
        Number of analysed new started processes analysed:2
        Number of new started drivers analysed:0
        Number of existing processes analysed:0
        Number of existing drivers analysed:0
        Number of injected processes analysed:0
        Technologies:
        • HCA enabled
        • EGA enabled
        • HDC enabled
        • AMSI enabled
        Analysis Mode:default
        Analysis stop reason:Timeout
        Detection:MAL
        Classification:mal76.expl.evad.winXLS@1/1@0/0
        EGA Information:Failed
        HDC Information:Failed
        HCA Information:
        • Successful, ratio: 100%
        • Number of executed functions: 0
        • Number of non-executed functions: 0
        Cookbook Comments:
        • Found application associated with file extension: .xls
        • Found Word or Excel or PowerPoint or XPS Viewer
        • Attach to Office via COM
        • Scroll down
        • Close Viewer
        • Corrupt sample or wrongly selected analyzer.
        • Exclude process from analysis (whitelisted): dllhost.exe
        No simulations
        No context
        No context
        No context
        No context
        No context
        Process:C:\Program Files\Microsoft Office\Office14\EXCEL.EXE
        File Type:data
        Category:dropped
        Size (bytes):512
        Entropy (8bit):0.0
        Encrypted:false
        SSDEEP:3::
        MD5:BF619EAC0CDF3F68D496EA9344137E8B
        SHA1:5C3EB80066420002BC3DCC7CA4AB6EFAD7ED4AE5
        SHA-256:076A27C79E5ACE2A3D47F9DD2E83E4FF6EA8872B3C2218F66C92B89B55F36560
        SHA-512:DF40D4A774E0B453A5B87C00D6F0EF5D753143454E88EE5F7B607134598294C7905CCBCF94BBC46E474DB6EB44E56A6DBB6D9A1BE9D4FB5D1B5F2D0C6ED34BFE
        Malicious:false
        Reputation:high, very likely benign file
        Preview:................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
        File type:Composite Document File V2 Document, Cannot read section info
        Entropy (8bit):5.059565165780792
        TrID:
        • Microsoft Excel sheet (alternate) (24509/1) 53.26%
        • Visual Basic Script (13500/0) 29.34%
        • Generic OLE2 / Multistream Compound File (8008/1) 17.40%
        File name:SecuriteInfo.com.Script.SNH-gen.9465.5598.xls
        File size:584704
        MD5:f12ff8c249bb5fa66bf7456dbd24d2f4
        SHA1:a95cb2684dc78798816008833da88f9e09031690
        SHA256:d89593a50b26663b82f9720ffaa24ba6c91216266c582333e469f9c48f6e2199
        SHA512:a3f17f4d82c520eca83f4c3f4c243e89d7eabf456fb1a653e60ec4d97b1ed87ff9117ba81ed0ad3f277a72da8142c46733663675f887ee86846e3f5e62e093ec
        SSDEEP:6144:1aR1CEqhx4eKc5bOSXAmx3BYebs7797Q1DmlhnTj9:1Lxhb5fxQ7BymTX9
        TLSH:1AC4E6C1B145C62BD6885A374C97D7F933B87D12AE856243F08D732E3E7E3889A19781
        File Content Preview:........................>.......................................................k.......h......................................................................................................................................................................
        Icon Hash:e4eea286a4b4bcb4
        Document Type:OLE
        Number of OLE Files:1
        Has Summary Info:
        Application Name:None
        Encrypted Document:False
        Contains Word Document Stream:False
        Contains Workbook/Book Stream:False
        Contains PowerPoint Document Stream:False
        Contains Visio Document Stream:False
        Contains ObjectPool Stream:False
        Flash Objects Count:0
        Contains VBA Macros:True
        General
        Stream Path:VBA/Arkusz1
        VBA File Name:Arkusz1.cls
        Stream Size:11153
        Data ASCII:. . . . . . . . . . . . . . X . . . . . . O . . . # . . . . . . . . . . T V . . c . . . . . . . . . . . . . . . . . . . . . C H ' ~ M . . . . . . . . . . . . . F . . . . . . . . . . . . . . . . . . . . " I Y z N . . & r . . . . . . . . . . . . . . . . . . . . . . x . . . . . ; . C o m m a n d B u t t o n N o _ A u t o F i l t r , 1 1 2 0 1 , 0 , M S F o r m s , C o m m a n d B u t t o n 9 . C o m m a n d B u t t o n C l o n e _ L i n e , 1 1 1 9 9 , 1 , M S F o r m s , C o m m a n d B u t
        Data Raw:01 16 03 00 06 d0 02 00 00 fa 16 00 00 b4 02 00 00 58 04 00 00 e1 17 00 00 4f 18 00 00 df 23 00 00 0a 00 00 00 01 00 00 00 54 a3 56 a3 00 00 ff ff 63 00 00 00 88 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff f0 00 ff ff 00 00 b6 97 97 98 b9 e3 1f 43 b6 c3 48 27 7e b0 8d 4d 20 08 02 00 00 00 00 00 c0 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00
        Attribute VB_Name = "Arkusz1"
        Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
        Attribute VB_GlobalNameSpace = False
        Attribute VB_Creatable = False
        Attribute VB_PredeclaredId = True
        Attribute VB_Exposed = True
        Attribute VB_TemplateDerived = False
        Attribute VB_Customizable = True
        Attribute VB_Control = "CommandButtonNo_AutoFiltr, 11201, 0, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonClone_Line, 11199, 1, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonDelete_Line, 11194, 2, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonInsert_Line, 11193, 3, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonSortuj, 11166, 4, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonImportujTXT, 1630, 5, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonEksport, 1822, 6, MSForms, CommandButton"
        Attribute VB_Control = "CommandButtonClear, 1823, 7, MSForms, CommandButton"
        Private Sub CommandButtonSortuj_Click()
         
            Dim Odp, Kom, Styl, Tytul
            'tmp = MsgBox("Dane zostay wyeksportowane pomylnie.", 64, "Eksport zlece")
            Kom = "Dane bd posortowane wg klucza: " & Chr(13) & Chr(13) & " -- Typ[2] /Char, [8] /Char, Nazwa PATNIKA[13] /Char, Nazwa odbiorcy[5] /Char -- " & Chr(13) & Chr(13) & "Czy kontynuowa?"
            Styl = vbYesNo + vbQuestion + vbDefaultButton2
            Tytul = "Sorting data"
            Odp = MsgBox(Kom, Styl, Tytul)
            
            If Odp = 6 Then
                Sortuj
            End If
            
        End Sub
        
        'Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
            'SelectedDate:=Date,     'MinimumDate:=Now(), 
            'moje (PK)
            On Error Resume Next
            
            'jeli zaznaczye wicej ni jedn komrk to nie pokazuj Kalendarza, moje (PK)
            If Target.Cells.Count > 1 Then Exit Sub
            
            
            If Not Intersect(Range("L6:L1005"), Target) Is Nothing Then
                  '??
                 Cancel = True
                  
                  Range(ActiveCell.Address) = CalendarForm.GetDate(             SelectedDate:=ActiveCell.Value,             FirstDayOfWeek:=Poniedziaek,             DateFontSize:=8,             TodayButton:=True,             OkayButton:=True,             ShowWeekNumbers:=True,             BackgroundColor:=RGB(             243, 249, 251), HeaderColor:=RGB(             147, 205, 2221), HeaderFontColor:=RGB(             255, 255, 255), SubHeaderColor:=RGB(             223, 240, 245), SubHeaderFontColor:=RGB(             31, 78, 120), DateColor:=RGB(             243, 249, 251), DateFontColor:=RGB(             31, 78, 120), TrailingMonthFontColor:=RGB(             155, 194, 230), DateHoverColor:=RGB(             223, 240, 245), DateSelectedColor:=RGB(             202, 223, 242), SaturdayFontColor:=RGB(             0, 176, 240), SundayFontColor:=RGB(             203, 108, 108), TodayFontColor:=RGB(             0, 176, 80))
            End If
        End Sub
        Private Sub CommandButtonNo_AutoFiltr_Click()
            
            ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True, AllowFiltering:=True, AllowSorting:=True
            'If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
            If Worksheets("przelewy").FilterMode = True Then Worksheets("przelewy").ShowAllData
        
        End Sub
        
        Private Sub CommandButtonInsert_Line_Click()
            Insert_Line
        End Sub
        
        Private Sub CommandButtonClone_Line_Click()
            Clone_Line
        End Sub
        
        Private Sub CommandButtonDelete_Line_Click()
            Delete_Line
        End Sub
        
        Private Sub CommandButtonClear_Click()
        
            Dim Odp, Kom, Styl, Tytul
            Kom = "All data will be removed." & Chr(13) & Chr(13) & "Continue?"
            Styl = vbYesNo + vbCritical + vbDefaultButton2
            Tytul = "Removing data"
            Odp = MsgBox(Kom, Styl, Tytul)
            
            If Odp = 6 Then
                Clear
            End If
        
        End Sub
        
        Private Sub CommandButtonEksport_Click()
            ExportToTextFiles
        End Sub
        
        Private Sub CommandButtonImportujTXT_Click()
            ImportFromTextFile
        End Sub
        
        Private Sub CommandButtonImportujUNZ_Click()
            ImportFromUNZFile
        End Sub
        
                Private Sub CommandButtonSoartuj_Click()
                    
                End Sub
        
        Private Sub Image1_Click()
        
        End Sub
        

        General
        Stream Path:VBA/CalendarForm
        VBA File Name:CalendarForm.frm
        Stream Size:180599
        Data ASCII:. . . . . \\ . . . . . . @ . . . 0 . . . . . . . . . 9 . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . X . . . D e . . C . E 1 B 8 . G F * $ o & f < . K G J . ! Y . . . . ` F . | > f L J 2 . . . . . . . . . . . . . . . . . . . . . . x . . . . ` F . | > f L J 2 D e . . C . E 1 B . . . . R . . . . . R . . . . . . . . . . . . . . . . . . . R . . . . . R . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . ` . 8 . @ . H . . ( . 0 . . . . . . S P . . . . S . . . . . S
        Data Raw:01 16 03 00 06 5c 01 00 00 ca 03 01 00 40 01 00 00 30 03 00 00 a9 04 01 00 df 09 01 00 ab 39 02 00 bd 00 00 00 01 00 00 00 54 a3 d6 da 00 00 ff ff 01 00 00 00 88 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 58 04 ff ff 00 00 bf e0 44 65 13 07 c1 43 b5 07 45 f5 f2 31 42 be e1 c9 38 93 99 ae 02 47 9a 46 2a 24 6f 26 ed 66 dd 3c bc dc 95 4b 9b 47 8d 4a 0d b8 21
        Attribute VB_Name = "CalendarForm"
        Attribute VB_Base = "0{28C0B3E5-D5E1-4561-A6A7-F6141EB7D32D}{9EA17A6B-1403-4F06-8E94-50DAAA45D3A9}"
        Attribute VB_GlobalNameSpace = False
        Attribute VB_Creatable = False
        Attribute VB_PredeclaredId = True
        Attribute VB_Exposed = False
        Attribute VB_TemplateDerived = False
        Attribute VB_Customizable = False
        
        
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        '
        '   CalendarForm
        '   Developed by Trevor Eyre
        '   trevoreyre@gmail.com
        '   v1.4 - 09.29.2014
        '   tumaczenie Adam Kope
        '   2015-01-09
        '
        '   Ten wyskakujcy kalendarz moe by uyty przez zaimportowanie pliku
        '   CalendarForm.frm do Twojego projektu VBA. Jest wywoywany przez funkcj GetDate.
        '   Po instrukcj jak wywoa CalendarForm, przeskocz do dokumentacji funkcji GetDate
        '   po sekcji Global Variables.
        '
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        
        
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        'Infomacje oglne
        '
        'Celem stworzenia tego formularza byo przedewszystkim uniknicia potwornoci jak
        'jest formant Microsoft MonthView. Jeli to czytasz, to prawdopodobnie wiesz
        'o czym mwi. Wielu uytkownikw na moim miejscu stworzyo wasne
        'wyskakujce kalendarze, eby rozwiza ten problem. Dlaczego stworzyem kolejny?
        '
        '
        'Byem przede wszystkim zainteesowany nastpujcymi funkcjonalnociami:
        '   -atwy w uyciu. Chciaem stworzy cakowicie samowystarczalny formularza, ktry mgby
        '   zosta zaimportowany do dowolnego projektu VBA i by uyty bez adnego dodatkowego kodu.
        '   -Prosty, atrakcyjny wygld. Wiele z zaprojektowanych w internecie wyskakujcych kalendarzy
        '   wyglda i pracuje dobrze, to aden z nich nie speni moich oczekiwa pod wzgldem
        '   stylu i desejnu Interfejsu Uytkownika
        '   -Cakowicie konfigurowalny funkcjonalno i wygld. Zamieciem tyle opcji z formantu
        '   MonthView ile tylko potrafiem, bez tworzenia zbytniego chaosu.
        '
        'Poniewa aden ze znalezionych przeze mnie wyskakujcych kalendarzy nie speni wszystkich
        'moich oczewiwa, stworzyem wasny. Mam nadziej,  jaka inna umczona dua
        'rwnie skorzysta z wynikw mojej pracy.
        '
        'Jeli natrafisz na jakiekolwiek bdy lub masz wspaniae pomysy lub potrzebujesz
        'dodatkowej opcji, ktra usprawniaby tego niegrzecznego chopca, prosz wylij mi maila.
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        
        
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        'Global Variables
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Option Explicit
        
        'Te dwie wartoci Enum s uyte w funkcji GetDate by uytkownik wybra pierwszy dzie
        'tygodnia oraz zachowanie numerw tygodni. S one uyte w miejsce Excelowych staych
        'vbDayOfWeek i vbFirstWeekOfYear w celu uniknicia mierzenia si z czasem systemowym,
        'ktry jest opcj w obu tych staych. Poza tym wartoci s identyczne.
        Public Enum calDayOfWeek
            Niedziela = 1
            Poniedziaek = 2
            Wtorek = 3
            roda = 4
            Czwartek = 5
            Pitek = 6
            Sobota = 7
        End Enum
        
        Public Enum calFirstWeekOfYear      'Kontroluje jak numery tygodni s obliczane i wywietlane
            FirstJan1 = 1                   'Tydzie z pierwszym Stycznia jest zawsze liczony jako pierwszy tydzie
            FirstFourDays = 2               'Pierwszy tydzie w Styczniu, ktry ma przynajmniej 4 dni jest
                                                'liczony jako pierwszy. To obliczenie bdzie si zmieina w zalenoci
                                                'od ustawie pierwszego dnia tygodnia. Standarf ISO
                                                'oblicza pierwszy tydzie jako pierwszy tydzie w Styczniu
                                                'z 4 dniami, gdzie Poniedziaek jest uznawany za pierwszy dzie tygodnia.
            FirstFullWeek = 3               'Pierwszy tydzie w Styczniu z wszystkimi dniami tygodnia jest liczony jako 1.
                                                'Podobnie jak ustawienie FirstFourDays, to obliczenie zmieni si
                                                'w zalenoci od ustawie pierwszego dnia tygodnia.
        End Enum
        
        Private UserformEventsEnabled As Boolean    'Kontroluje eventy formularza uytkownika
        Private DateOut As Date                     'Data zwracana przez CalendarForm
        Private SelectedDateIn As Date              'Wybrana data pocztkowa, jak i data aktualnie wybrana przez
                                                        'uytkownika jeeli przycisk Okay jest wczony
        Private OkayEnabled As Boolean              'Przechowuje warto, czy przycisk Okay jest wczony
        Private TodayEnabled As Boolean             'Przechowuje warto, czy przycisk Today (Dzi) jest wczony
        Private MinDate As Date                     'Minimalna data ustawiona przez uytkownika
        Private MaxDate As Date                     'Maksymalna data ustawiona przez uytkownika
        Private cmbYearMin As Long                  'Aktuualna dolna granica dla combobox roku. Nie koniecznie ograniczona do tego min
        Private cmbYearMax As Long                  'Aktuualna grna granica dla combobox roku. Nie koniecznie ograniczona do tego max
        Private StartWeek As VbDayOfWeek            'Pierwszy dzie tygodnia w kalendarzu
        Private WeekOneOfYear As VbFirstWeekOfYear  'Pierwszy tydzie w roku uywasz numerw tygodni (gdy numery tygodni s ustawione)
        Private HoverControlName As String          'Nazwa kontrolki/etykiety, nad ktr aktualnie unosi si kursor myszki. Wykorzystywana wtedy, gdy
                                                        'przywracay jej oryginalnego koloru.
        Private HoverControlColor As Long           'Oryginalny kolor kontrolki/etykiety nad ktr si aktualnie unosi kursor myszki
        Private RatioToResize As Double             'Wspczynnik z jakim s przeskalowywane elementy formularza uytkownika. Jest ustawione przez argument DateFontSize
                                                        'w funkcji GetDate
        Private bgDateColor As Long                 'Kolor ta etykiety daty
        Private bgDateHoverColor As Long            'Kolor ta etykiety daty kiedy najedasz na ni myszk
        Private bgDateSelectedColor As Long         'Kolor ta etykiety daty, ktra jest wybrana
        Private lblDateColor As Long                'Kolor czcionki dla etykiety daty
        Private lblDatePrevMonthColor As Long       'Kolor czcionki dla etykiety dat nie z aktualnego miesica
        Private lblDateTodayColor As Long           'Kolor czcionki dzisiejszej daty
        Private lblDateSatColor As Long             'Kolor czcionki dla Soboty
        Private lblDateSunColor As Long             'Kolor czcionki dla Niedzieli
        
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        'GetDate
        '
        'Ta funkcja jest punktem wejcia do formularza CalendarForm. Kontroluje WSZYSTKO.
        'Kady argument jest opcjonalny, co znaczy, e Twoje wywoanie funkcji moe by tak porste jak:
        '
        '   MyDateVariable = CalendarForm.GetDate
        '
        'To wszystko czego potrzeba. Kalendarz si otwiera, wyskakuje, uytkownik wybiera dat,
        'wybrana data trafia do wskazanej przez Ciebie zmiennej, a kalendarz si wycza.
        '
        'Z tego miejsca moesz uy tak wiele lub tak mao argumentw jak potrzebujesz w celu uzyskania
        'dokadnie takiego kalendarza, ktry odpowiada Twoim potrzebom. Wszystkie domylne wartoci s take ustawione w tej
        'funkcji, wic jeli chcesz zmieni domylny kolor lub zachowanie bez potrzeby ustawiania go
        'w kadej wywoywanej funkcji, moesz to zrobi w licie argumentw funkcji poniej.
        '
        'Poniej jest lista wszystkich argumentw, ich rodzaj i ich funkcjonalno/opcja:
        '
        '   SelectedDate (Date) - To jest wybrana data pocztkowa w kalendarzu. Domylnie
        '       pokazuje ostatni wybr uytkownika. Jeeli ta warto jest ustawiona, to kalendarz bdzie
        '       wskazywa miesic i rok w niej wskazany. Jeeli ta zmienna nie jest ustawiona, to kalendarz bdzie
        '       rozpoczyna z dzisiejsz dat (bez zaznaczenia).
        '   FirstDayOfWeek (calDayOfWeek) - Ustawia, ktry dzie tygodnia ma by traktowany jako pierwszy (np: Poniedziaek)
        '   MinimumDate (Date) - Ograniczenie wybierania dat od dou (data minimalna).
        '   MaximumDate (Date) - Ograniczenie wybierania dat od gry (data maksymalna)
        '   RangeOfYears (Long) - Ustawia zasig dat w latach do pokazywania w oknie rozwijanym dat
        '       w obu kierunkach od daty pocztkowej SelectedDate. Np: jeeli
        '       SelectedDate jest w 2014 i RangeOfYears jest ustawiony na 10 (warto domylna),
        '       okno rozwijane lat bdzie pokazywa od 10 lat poniej roku 2014 do 10 lat powyej 2014, czyli
        '       bdzie to zakres od 2004 do 2024. We pod uwag, e jeli ten zakres bdzie poza granicami
        '       ustawionymi przez MinimumDate lub MaximumDate, bdzie nadpisane. Dodatkowo ten
        '       zakres NIE ogranicza lat, ktre uytkownik moe wybra. Jeeli grna granica w oknie rozwijanym
        '       jest ustawiona do 2024, a uytkownik kliknie nastpny miesic tyle razy, e przekroczy
        '       Grudzie 2024, bdzie przesuwa si dalej przez rok 2025 i dalej (i te lata
        '       bd dodane do listy rozwijanej lat).
        '   DateFontSize (Long) - Kontroluje rozmiar formularza CalendarForm. Ta warto nie moe
        '       by ustawiona poniej 9 (wartoci domylnej). eby powikszy formularz, ustaw t warto na wiksz,
        '       i wszystkie pozostae elementy w formularzu bd odpowiednio dopasowane.
        '   TodayButton (Boolean) - Kontroluje czy ma si pokazywa przycisk Dzi.
        '   OkayButton (Boolean) - Kontroluje czy ma si pokazywa przycisk Okay. Jeeli przycisk
        '       Okay jest wczony, kiedy uytkownik wybierze dat podwietla si ona, ale
        '       nie jest zwracana dopki uytkownik nie kliknie przycisku Okay. Jeeli przycisk Okay jest wyczony,
        '       kliknicie daty automatycznie zwrci dat i wyczy formularz.
        '   ShowWeekNumbers (Boolean) - Kontroluje czy maj si pokazywa numery tygodni.
        '   FirstWeekOfYear (calFirstWeekOfYear) - Ustawia sposb liczenia/numeracji tygodni w roku. Zobacz
        '       calFirstWeekOfYear Enum w sekcji Global Variables by zobaczy moliwoci wartoci
        '       i ich zachowanie.
        '   PositionTop (Long) - Ustawia pozycj grnej krawdzi formularza CalendarForm. Jeeli, adana warto
        '       nie jest przypisana,  CalendarForm jest ustawiony w pozycji 1 - CenterOwner. We pod uwag, e
        '       oba argumenty PositionTop i PositionLeft musz by ustawione by nadpisa ustawienia domylne
        '       - wyrodkowan pozycj.
        '   PositionLeft (Long) - Ustawia pozycj lewej krawdzi formularza CalendarForm. Jeeli, adana warto
        '       nie jest przypisana,  CalendarForm jest ustawiony w pozycji 1 - CenterOwner. We pod uwag, e
        '       oba argumenty PositionTop i PositionLeft musz by ustawione by nadpisa ustawienia domylne
        '       - wyrodkowan pozycj.
        '   BackgroundColor (Long) - Ustawia kolor ta formularza CalendarForm.
        '   HeaderColor (Long) - Ustawia kolor ta nagwka. Nagwek jest etykiet na grze formularza
        '       zawierajc rok i miesic.
        '   HeaderFontColor (Long) - Ustawia kolor czcionki w nagwku.
        '   SubHeaderColor (Long) - Ustawia kolor ta tekstu pod nagwkiem. Tekst pod nagwkiem
        '       to skrt dnia tygodnia (Pn, Wt, itd).
        '   DateColor (Long) - Ustawia kolor ta pojedynczej etykiety daty.
        '   DateFontColor (Long) - Ustawia kolor czcionki pojedynczej etykiety daty.
        '   SaturdayFontColor (Long) - Ustawia kolor czcionki dla Soboty.
        '   SundayFontColor (Long) - Ustawia kolor czcionki dla Niedzieli.
        '   DateBorder (Boolean) - Kontroluje czy pojedyncza etykieta daty ma krawdzie.
        '   DateBorderColor (Long) - Ustawia kolor krawdzie etykiety daty. We pod uwag, e
        '       argument DateBorder musi by ustawiony na True eby to ustawienie odnioso efekt.
        '   DateSpecialEffect (fmSpecialEffect) - Ustawia efekt specjalny dla pojedynczych etykiet dat.
        '       Ten argument moe by ustawiony na bump, etched, flat (warto domylna), raised, or sunken.
        '       Ten argument moe zosta uyty by etykiety dat wyglday jak przyciski, jeli chcesz.
        '       We pod uwag, e to ustawienie nadpisuje jakiekolwiek ustawienie krawdzi jakie wczysz.
        '   DateHoverColor (Long) - Ustawia kolor ta gdy najedasz myszk nad
        '       pojedyncz etykiet daty.
        '   DateSelectedColor (Long) - Ustawia kolor ta wybranej daty.
        '   TrailingMonthFontColor (Long) - Ustawia kolor dat w etykietach dat, ktre s z innego ni aktualny
        '       miesic, czyli s to daty z poprzedniego miesica (u gry z lewej strony)
        '       i nastpnego miesica (na dole z prawej strony).
        '   TodayFontColor (Long) - Ustawia kolor dla dzisiejszej daty.
        '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Public Function GetDate(Optional SelectedDate As Date,     Optional FirstDayOfWeek As calDayOfWeek = Niedziela     , Optional MinimumDate As Date     , Optional MaximumDate As Date     , Optional RangeOfYears As Long     = 10, Optional DateFontSize As Long     = 9, Optional TodayButton As Boolean     = False, Optional OkayButton As Boolean = False, Optional ShowWeekNumbers As Boolean     = False, Optional FirstWeekOfYear As calFirstWeekOfYear = FirstJan1, Optional PositionTop As Long     = -5, Optional PositionLeft As Long = -5, Optional BackgroundColor As Long     = 16777215, Optional HeaderColor As Long     = 15658734, Optional HeaderFontColor As Long     = 0, Optional SubHeaderColor As Long     = 16448250, Optional SubHeaderFontColor As Long     = 8553090, Optional DateColor As Long     = 16777215, Optional DateFontColor As Long     = 0, Optional SaturdayFontColor As Long     = 0, Optional SundayFontColor As Long     = 0, Optional DateBorder As Boolean     = False, Optional DateBorderColor As Long = 15658734, Optional DateSpecialEffect As fmSpecialEffect     = fmSpecialEffectFlat, Optional DateHoverColor As Long     = 15658734, Optional DateSelectedColor As Long     = 14277081, Optional TrailingMonthFontColor As Long     = 12566463, Optional TodayFontColor As Long     = 15773696) As Date
            
            Dim DefaultFontSize As Long         'Domylny rozmiar czcionki(i zarazem minimalny). Uywant do skalowania za pomoc RatioToResize
            Dim TempDate As Date                'Uywany do ustalenie daty, jel adna nie zostaa podana
            Dim SelectedYear As Long            'Rok podanej daty
            Dim SelectedMonth As Long           'Miesic podanej daty
            Dim SelectedDay As Long             'Dzie podanej daty (jeli odpowiedni)
            Dim TempDayOfWeek As Long           'Uywany do ustawiania nagwkw dni tygodnia
            Dim i As Long                       'Uywane do ptli
            Dim j As Long                       'Uywane do ptli
            
            UserformEventsEnabled = False
            DefaultFontSize = 9
            
            'Domylne wartoci dla MinDate i MaxDate. Jeli ani MinimumDate ani MaximumDate
            'nie zostanie podana MinDate zostanie ustawiona na 1900-01-01, a MaxDate
            'na 9999-12-31. Jeeli MaxDate jest mniejsza ni MinDate, zostanie ustawiona na warto MinDate.
            If Year(MinimumDate) = 1899 Then
                MinDate = CDate("1/1/1999")
            ElseIf Year(MinimumDate) < 1999 Then
                MinDate = CDate("1/1/1999")
            Else
                MinDate = MinimumDate
            End If
            If Year(MaximumDate) = 1899 Then
                MaxDate = CDate("12/31/9999")
            Else
                MaxDate = MaximumDate
            End If
            If MaxDate < MinDate Then MaxDate = MinDate
            
            'Ustaw przyciski Okay i Dzi. Jeeli dzisiejsza data jest poza min/max, wtedy
            'przycisk Dzi zostanie wyczony, bez wzgldu na jego ustawienie.
            OkayEnabled = OkayButton
            TodayEnabled = TodayButton
            If Date < MinDate Or Date > MaxDate Then TodayEnabled = False
        
            'Warto pocztkowa pozycji formularza uytkownika. Domyln wartoci jest -5 da grnej i lewej krawdzi. Sprawd
            't warto czy inna warto nie zostaa zadana. Jeli nie, to ustaw pozycj
            'na CenterOwner. Musisz ustawi obie wartoci by nadpisa pozycj wyrodkowan (CenterOwner).
            If PositionTop <> -5 And PositionLeft <> -5 Then
                Me.StartUpPosition = 0
                Me.Top = PositionTop
                Me.Left = PositionLeft
            Else
                Me.StartUpPosition = 1
            End If
            
            'Warto pocztkowa rozmiaru formularza uytkownika. Jeeli rozmiar czcionki jest mniejsza ni domylna, wtedy
            'zostanie ustawiona na domyln. RatioToResize jest skal ustawionego rozmiaru czcionki do
            'domylnego rozmiaru. Ta zmiennna jest wykorzystana by przeskalowa pozostae elementy kalendarza.
            If DateFontSize < DefaultFontSize Then DateFontSize = DefaultFontSize
            RatioToResize = DateFontSize / DefaultFontSize
            Call SetUserformSize(DateFontSize, ShowWeekNumbers)
            
            'Ustawianie SelectedDateIn. Rok bdzie ustawiony na 1899 jeeli adna data nie zostanie podana
            'w takim przypadku data zostanie ustawiona na dzisiejsz dat. Jeeli wskazana data jest
            'poza granicami minimalnej lub maksymalnej daty, zostanie odpowiednio nadpisana.
            If Year(SelectedDate) <> 1899 Then
                If SelectedDate < MinDate Then
                    SelectedDate = MinDate
                ElseIf SelectedDate > MaxDate Then
                    SelectedDate = MaxDate
                End If
                SelectedDateIn = SelectedDate
                SelectedYear = Year(SelectedDateIn)
                SelectedMonth = Month(SelectedDateIn)
                SelectedDay = Day(SelectedDateIn)
                Call SetSelectionLabel(SelectedDateIn)
            Else 'Jeli SelectedDate nie podana zamie na dzisiejsz dat.
                cmdOkay.Enabled = False
                TempDate = Date
                If TempDate < MinDate Then
                    TempDate = MinDate
                ElseIf TempDate > MaxDate Then
                    TempDate = MaxDate
                End If
                SelectedYear = Year(TempDate)
                SelectedMonth = Month(TempDate)
                SelectedDay = 0 'Nie chcemy podwietla zaznaczonej daty poniewa uytkownik nie poda adnej.
                Call SetSelectionLabel(Empty)
            End If
            
            'Pocztkowy miesic i rok na licie rozwijanej (combobox) oraz miesic na pasku przewijania.
            'Upewnia si, e rok jest z przedziau od 1900 do 9999. Jeeli lista rozwijana wypadnie
            'poza granice MinDate lub MaxDate zostanie nadpisana.
            Call SetMonthCombobox(SelectedYear, SelectedMonth)
            scrlMonth.Value = SelectedMonth
            cmbYearMin = SelectedYear - RangeOfYears
            cmbYearMax = SelectedYear + RangeOfYears
            If cmbYearMin < Year(MinDate) Then
                cmbYearMin = Year(MinDate)
            End If
            If cmbYearMax > Year(MaxDate) Then
                cmbYearMax = Year(MaxDate)
            End If
            For i = cmbYearMin To cmbYearMax
                cmbYear.AddItem i
            Next i
            cmbYear.Value = SelectedYear
            
            'Ustaw kolory i efekty kalendarza (formularza)
            Me.BackColor = BackgroundColor
            bgHeader.BackColor = HeaderColor
            bgScrollCover.BackColor = HeaderColor
            lblMonth.ForeColor = HeaderFontColor
            lblYear.ForeColor = HeaderFontColor
            lblSelection.ForeColor = SubHeaderFontColor
            lblSelectionDate.ForeColor = SubHeaderFontColor
            bgDayLabels.BackColor = SubHeaderColor
            For i = 1 To 7
                Me("lblDay" & CStr(i)).ForeColor = SubHeaderFontColor
            Next i
            If ShowWeekNumbers Then
                lblWk.ForeColor = SubHeaderFontColor
                For i = 1 To 6
                    Me("lblWeek" & CStr(i)).ForeColor = SubHeaderFontColor
                Next i
            End If
            bgDateColor = DateColor
            lblDateColor = DateFontColor
            lblDateSatColor = SaturdayFontColor
            lblDateSunColor = SundayFontColor
            For i = 1 To 6
                For j = 1 To 7
                    With Me("bgDate" & CStr(i) & CStr(j))
                        If DateBorder Then
                            .BorderStyle = fmBorderStyleSingle
                            .BorderColor = DateBorderColor
                        End If
                        .SpecialEffect = DateSpecialEffect
                    End With
                Next j
            Next i
            bgDateHoverColor = DateHoverColor
            bgDateSelectedColor = DateSelectedColor
            lblDatePrevMonthColor = TrailingMonthFontColor
            lblDateTodayColor = TodayFontColor
            
            'Ustaw nagwki dla dni tygodnia na podstawie wybranego pierwszego dnia tygodnia
            StartWeek = FirstDayOfWeek
            WeekOneOfYear = FirstWeekOfYear
            TempDayOfWeek = StartWeek
            For i = 1 To 7
                Me("lblDay" & CStr(i)).Caption = Choose(TempDayOfWeek, "N", "Pn", "Wt", "r", "Cz", "Pt", "So")
                TempDayOfWeek = TempDayOfWeek + 1
                If TempDayOfWeek = 8 Then TempDayOfWeek = 1
            Next i
                    
            'Ustaw etykiety miesica i roku w nagwku oraz etykiety dat (dni)
            Call SetMonthYear(SelectedMonth, SelectedYear)
            Call SetDays(SelectedMonth, SelectedYear, SelectedDay)
            
            'Poka kalendarz (formularz). Zwr wybran dat i wycz kalendarz
            UserformEventsEnabled = True
            Me.Show
            GetDate = DateOut
            Un

        General
        Stream Path:VBA/Module1
        VBA File Name:Module1.bas
        Stream Size:5108
        Data ASCII:. . . . . . . . . . . . . . x . . . . . . . J . . . . . . . . . . . T . . . . . . . . . . . . . l . . . . . v . . . . . . . . . . . . . . . . . . . . . . . . . . S H G e t P a t h F r o m I D L i s t A . . . . . . v . X . . . . . . . . . . . . . . . . . . . . . . . . . . . S H B r o w s e F o r F o l d e r A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . .
        Data Raw:01 16 03 00 03 b8 01 00 00 aa 08 00 00 9c 01 00 00 78 02 00 00 ff ff ff ff 2e 09 00 00 4a 10 00 00 00 00 00 00 01 00 00 00 54 a3 c8 ee 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 6c 00 00 00 00 00 76 04 20 00 00 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 53 48 47 65 74 50 61 74 68 46 72 6f 6d 49 44 4c 69 73 74 41 00 00 00 00 00 00 76 04 58
        Attribute VB_Name = "Module1"
        Private Const BIF_RETURNONLYFSDIRS As Long = &H1
        Private Const BIF_DONTGOBELOWDOMAIN As Long = &H2
        Private Const BIF_RETURNFSANCESTORS As Long = &H8
        Private Const BIF_BROWSEFORCOMPUTER As Long = &H1000
        Private Const BIF_BROWSEFORPRINTER As Long = &H2000
        Private Const BIF_BROWSEINCLUDEFILES As Long = &H4000
        Private Const MAX_PATH As Long = 260
        
        Type BrowseInfo
            hOwner As Long
            pidlRoot As Long
            pszDisplayName As String
            lpszINSTRUCTIONS As String
            ulFlags As Long
            lpfn As Long
            lParam As Long
            iImage As Long
        End Type
        
        Type SHFILEOPSTRUCT
            hwnd As Long
            wFunc As Long
            pFrom As String
            pTo As String
            fFlags As Integer
            fAnyOperationsAborted As Boolean
            hNameMappings As Long
            lpszProgressTitle As String
        End Type
        
        #If VBA7 Then
            Declare PtrSafe Function SHGetPathFromIDListA Lib "shell32.dll" (        ByVal pidl As Long,      ByVal pszBuffer As String) As Long
        
            Declare PtrSafe Function SHBrowseForFolderA Lib "shell32.dll" (        lpBrowseInfo As BrowseInfo) As Long
         #Else
            Declare Function SHGetPathFromIDListA Lib "shell32.dll" (        ByVal pidl As Long,       ByVal pszBuffer As String) As Long
        
            Declare Function SHBrowseForFolderA Lib "shell32.dll" (        lpBrowseInfo As BrowseInfo) As Long
        #End If
         
        
        
        Function BrowseFolder(Optional Caption As String = "") As String
        
            Dim BrowseInfo As BrowseInfo
            Dim FolderName As String
            Dim ID As Long
            Dim Res As Long
        
            With BrowseInfo
                .hOwner = 0
                .pidlRoot = 0
                .pszDisplayName = String$(MAX_PATH, vbNullChar)
                .lpszINSTRUCTIONS = Caption
                .ulFlags = BIF_RETURNONLYFSDIRS
                .lpfn = 0
            End With
        
            FolderName = String$(MAX_PATH, vbNullChar)
        
            ID = SHBrowseForFolderA(BrowseInfo)
        
            If ID Then
                Res = SHGetPathFromIDListA(ID, FolderName)
                If Res Then
                    BrowseFolder = Left$(FolderName, InStr(FolderName,                 vbNullChar) - 1)
                End If
                End If
        
        End Function
        
        
        

        General
        Stream Path:VBA/Module9
        VBA File Name:Module9.bas
        Stream Size:7739
        Data ASCII:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . 6 . . . . . . < . . . . . . . < . . . . . . . < . . . . . . . . . . . . . . . . @ . . . . . . . .
        Data Raw:01 16 03 00 03 f0 00 00 00 da 05 00 00 d4 00 00 00 b0 01 00 00 ff ff ff ff 08 06 00 00 1c 18 00 00 00 00 00 00 01 00 00 00 54 a3 2e 73 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        Attribute VB_Name = "Module9"
        Const START_ROW = 6
        Const END_ROW = 1005
        Const END_COL = "AG"
        
        Sub Clear()
        Attribute Clear.VB_Description = "Makro zarejestrowane 2005-11-02"
        Attribute Clear.VB_ProcData.VB_Invoke_Func = " \n14"
        '
        ' Clear Makro
        ' Makro zarejestrowane 2005-11-02
        '
        Dim i As Integer
        Const END_ROW = 505
        'For i = 2 To 52 Step 2
        '    Range(Cells(6, i), Cells(END_ROW, i)).ClearContents
        'Next
        'Range(Cells(6, 2), Cells(END_ROW, 27)).ClearContents
        Range("_zlecenia_DANE").ClearContents
        
        Cells(6, 1).Select
        End Sub
        Sub Sortuj()
        '
        ' Sortuj Makro
        ' Makro zarejestrowane 2015-04-02
        '
        'Dim i As Integer
        
            Const START_ROW = 6
            Const END_ROW = 505
            
            Application.ScreenUpdating = False
                    
            'Range(Cells(START_ROW, 2), Cells(END_ROW, 29)).Sort Key1:=Range(Cells(START_ROW, 5)), Order1:=xlAscending, Header:=xlNo
            'Range(Cells(START_ROW, 2), Cells(END_ROW, 29)).Sort Key1:=Cells(START_ROW, 5), Order1:=xlAscending, Header:=xlNo
            
            'ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True
            'Protect, even if already protected
               
            'ThisWorkbook.Worksheets("przelewy").AutoFilterMode = True
            
            
                'ActiveSheet.Range("_zlecenia_DANE").AutoFilter
            
            'ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", DrawingObjects:=True,     'Contents:=True, Scenarios:=True, AllowFiltering:=True,     'userinterfaceonly:=True
            
        
            
            'Range(Cells(START_ROW, 2), Cells(END_ROW, 29)).Sort Key1:=Cells(START_ROW, 2), Order1:=xlAscending, Key2:=Cells(START_ROW, 8), Order2:=xlAscending, Key3:=Cells(START_ROW, 5), Order2:=xlAscending, Header:=xlNo
            'to samo co wyej ale sortowany obszar to nazwa zdefiniowanego zakresu danych zlece (bez kolumny Lp)
                'Range("_zlecenia_DANE").Sort Key1:=Cells(START_ROW, 2), Order1:=xlAscending, Key2:=Cells(START_ROW, 8), Order2:=xlAscending, Key3:=Cells(START_ROW, 5), Order3:=xlAscending, Header:=xlNo
            
            'to samo co wyej ale sortowany obszar to nazwa zdefiniowanego zakresu danych zlece (bez kolumny Lp)
            'poniewa jest wicej ni 3 klucze sortowania, sortowanie od tyu tj. najpierw 4-ty klucz a potem 3 pierwsze
            Range("_zlecenia_DANE").Sort Key1:=Cells(START_ROW, 5), Order1:=xlAscending, Header:=xlNo
            Range("_zlecenia_DANE").Sort Key1:=Cells(START_ROW, 2), Order1:=xlAscending, Key2:=Cells(START_ROW, 8), Order2:=xlAscending, Key3:=Cells(START_ROW, 13), Order3:=xlAscending, Header:=xlNo
            
            
                'sortuj cay zakres, razem z Lp. Potem, po wykonaniu dziaa dla tworzenia pliku zlece, powrt do wykazu posortowanego po Lp (jak byo pierwotnie).
                'poniewa jest wicej ni 3 klucze sortowania, sortowanie od tyu tj. najpierw 4-ty klucz a potem 3 pierwsze
                    'Range("_zlecenia_LP").Sort Key1:=Cells(START_ROW, 19), Order1:=xlAscending, Header:=xlNo
                    'Range("_zlecenia_LP").Sort Key1:=Cells(START_ROW, 2), Order1:=xlAscending, Key2:=Cells(START_ROW, 13), Order2:=xlAscending, Key3:=Cells(START_ROW, 12), Order3:=xlAscending, Header:=xlNo
                'sortuj cay zakres, razem z Lp po wartoci Lp aby powrci do wykazu pierwotnego uytkownika (po obliczeniach).
                    'Range("_zlecenia_LP").Sort Key1:=Cells(START_ROW, 1), Order1:=xlAscending, Header:=xlNo
            
            Application.ScreenUpdating = True
            
            Cells(6, 1).Select
        End Sub
        
        Sub ClearPayroll()
        ActiveWorkbook.Activate
        '
        ' Clear Makro
        ' Makro zarejestrowane 2005-11-02
        '
        Dim i As Integer
        Const END_ROW = 505
        For i = 2 To 8
            Range(Cells(6, i), Cells(END_ROW, i)).ClearContents
        Next
        For i = 10 To 11
            Range(Cells(6, i), Cells(END_ROW, i)).ClearContents
        Next
        Cells(6, 1).Select
        End Sub
        
        Sub FillPipes()
        Attribute FillPipes.VB_Description = "Makro zarejestrowane 2005-11-02"
        Attribute FillPipes.VB_ProcData.VB_Invoke_Func = " \n14"
            Dim i As Integer
            Const END_ROW = 505
            For i = 3 To 51 Step 2
                Range(Cells(6, i), Cells(END_ROW, i)) = "|"
            Next
        End Sub
        

        General
        Stream Path:VBA/PaczkiPlacowe
        VBA File Name:PaczkiPlacowe.bas
        Stream Size:23833
        Data ASCII:. . . . . . . . . . . . . . . . . . . . . C . . . . . . . . . . T > . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . ( . . . . . . < p . . . . . . < x . . . . . 6 . . . . . . . . . . . . . . . . . . . . . . . . . x .
        Data Raw:01 16 03 00 06 f6 00 00 00 c0 0e 00 00 da 00 00 00 b6 01 00 00 ff ff ff ff 03 0f 00 00 9b 43 00 00 08 00 00 00 01 00 00 00 54 a3 86 3e 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        Attribute VB_Name = "PaczkiPlacowe"
        '2013-02-11
        Const START_ROW = 6
        Const END_ROW = 205
        Const SZABLON = "1230708"
        Const SZABLON_STARY = "3220106"
        Const SEPARATOR = "|"
        Const PRZELEW_PLACOWY = 5
        Const PACZKA_ZWYKLA = 1
        Const PACZKA_PLACOWA = 2
        'Option Explicit
        #Const LateBind = True
        
        'weryfukacja NRB
        Public Function IBANOKPL(ByVal IBAN As String) As Boolean
            IBANOKPL = IBANOK("PL" & IBAN)
        End Function
        'weryfikacja IBAN
        Public Function IBANOK(ByVal IBAN As String) As Boolean
          Dim IBANstr As String
          Dim i As Long
          ' moe zawera tylko cyfry, spacje i mylniki i musi by duszy ni 5 znakw po czyszczeniu
          IBANstr = Replace(IBAN, " ", "")
          IBANstr = Replace(IBANstr, "-", "")
          If Len(IBANstr) < 5 Then
            IBANOK = False
            Exit Function
          End If
          'kod kraju i cyfra kontrolna na koniec
          IBANstr = Mid(IBANstr, 5) & Mid(IBANstr, 1, 4)
          ' literki na cyferki
          For i = 65 To 90
            IBANstr = Replace(IBANstr, Chr(i), i - 64 + 9, , , vbTextCompare)
          Next
          'sprawdzanie
          IBANOK = ModuloBig(IBANstr, 97) = 1
        End Function
        
        Function ModuloBig(ZahlString As String, Divisor As Long) As Long
          Dim TeilStart As Long
          Dim TeilEnd As Long
          Dim Erg As Long
          Dim Rest As Long
          Dim ErgebnisGanzString As String
          Dim TeilZahl As Long
         
          TeilStart = 1
          TeilEnd = 1
         
          Do While TeilEnd <= Len(ZahlString)
            TeilZahl = val(Rest & Mid(ZahlString, TeilStart, TeilEnd - TeilStart + 1))
         
            If TeilZahl >= Divisor Then
              Erg = Int(TeilZahl / Divisor)
              Rest = TeilZahl - Erg * Divisor
         
              ErgebnisGanzString = ErgebnisGanzString + CStr(Erg)
         
              TeilStart = TeilEnd + 1
              TeilEnd = TeilStart
            Else
              If ErgebnisGanzString <> "" Then
                ErgebnisGanzString = ErgebnisGanzString & "0"
              End If
         
              TeilEnd = TeilEnd + 1
            End If
          Loop
         
          If TeilStart <= Len(ZahlString) Then
            Rest = val(Rest & Mid(ZahlString, TeilStart))
          End If
          ModuloBig = Rest
        End Function
        Public Function TeTrue(Source)
            TeTrue = True
        End Function
        Function PregMatch(Source, Pattern As String)
            Dim reg As Object
            Dim R As Boolean
            Set reg = CreateObject("vbscript.regexp")
            reg.IgnoreCase = False
            reg.MultiLine = False
            reg.Pattern = Pattern
            R = reg.test(Source)
            PregMatch = R
        End Function
        'zapis paczki pacowej
        Sub ExportPayrollToTextFiles()
            ActiveWorkbook.Activate
            'ActiveSheet.Unprotect
           ' Rows("1:1").Select
           ' Selection.ClearContents
            
            Dim Typ As Integer
            Dim tmp As String
            Dim tmp1 As String
            
            Dim row As Integer
            Dim curIdx As Integer
            Dim fCount As Integer
            Dim sep As String
            Dim overwrite As Integer
            Dim fname As Variant
            Dim fs As FileSystemObject, f As TextStream
            Set fs = New FileSystemObject
            
            overwrite = 0
            curIdx = 0
            fCount = 1
            row = START_ROW
            While row <= END_ROW
            If Cells(row, 2).Value <> "" Then
                    If curIdx Mod 200 = 0 Then
                        If Not f Is Nothing Then
                            f.Close
                         End If
                         Const FILE_NAME = "C:\przelewy.txt"
                         fname = Application.GetSaveAsFilename(FILE_NAME, "Pliki tekstowe (*.txt), *.txt", 1, "Zapisz plik", "Zapisz")
                         If fname = False Then
                                MsgBox "Nie podano nazwy pliku. Operacja zaniechana."
                                Exit Sub
                        End If
                                     
                        Set f = fs.CreateTextFile(fname, True)
                        
                        fCount = fCount + 1
                        f.Write SZABLON & SEPARATOR & PACZKA_PLACOWA
                        f.Write Chr(13)
                        f.Write Chr(10)
                    End If
                    'typ = PRZELEW_PLACOWY
                    tmp = PRZELEW_PLACOWY & SEPARATOR
                    For i = 2 To 11
                        tmp1 = CStr(Cells(row, i).Value)
                        'walidacja
                        Select Case i
                            Case 2:
                                If IBANOKPL(tmp1) Then
                                    If Mid$(tmp1, 3, 4) <> "1090" Then
                                        MsgBox "Rachunek rdowy w rekordzie " & curIdx + 1 & " (WN) nie jest prowadzony w BZ WBK. Operacja eksportu anulowana.", vbCritical
                                        
                                        Exit Sub
                                    Else
                                        'ok
                                    End If
                                Else
                                    MsgBox "Rachunek rdowy w rekordzie " & curIdx + 1 & " (WN) jest nieprawidowy. Operacja eksportu anulowana.", vbCritical
                                    
                                    Exit Sub
                                End If
                            Case 3:
                                If IBANOKPL(tmp1) Then
                                    'ok
                                Else
                                    MsgBox "Rachunek docelowy w rekordzie " & curIdx + 1 & " (MA) jest nieprawidowy. Operacja eksportu anulowana.", vbCritical
                                    
                                    Exit Sub
                                End If
                            Case 9:
                                If tmp1 = 3 Then
                                    ans = MsgBox("Transakcja w rekordzie " & curIdx + 1 & " ma ustawiony typ realiazcji SORBNET. Czy zmieni na ELIXIR?", vbInformation + vbYesNoCancel, "Istniej pliki o tej samej nazwie")
                                    If ans = vbYes Then
                                        tmp1 = 1
                                    ElseIf ans = vbCancel Then
                                        MsgBox "Operacja zaniechana."
                                        Exit Sub
                                    End If
                                Else
                                    'ok
                                End If
                            Case 11:
                                If PregMatch(tmp1, "^\d{2}-\d{2}-\d{4}$") Then
                                    'ok
                                ElseIf tmp1 = "" Then
                                    'ok
                                ElseIf PregMatch(tmp1, "^\d{4}-\d{2}-\d{2}$") Then
                                    'domylny fmat xls, konwersja
                                    tmp1 = Format(tmp1, "DD-MM-YYYY")
                                Else
                                    MsgBox "Data realizacji przelewu w rekordzie " & curIdx + 1 & " (MA) jest nieprawidowa. Operacja eksportu anulowana.", vbCritical
                                End If
                        End Select
                        tmp = tmp & tmp1
                        tmp = tmp & SEPARATOR
                        
                    Next
                    curIdx = curIdx + 1
                    f.Write tmp
                    f.Write Chr(13)
                    f.Write Chr(10)
                End If
                row = row + 1
            Wend
            
            
            If Not f Is Nothing Then
                f.Close
            End If
            Set fs = Nothing
           
            Cells(1, 1).Select
            ActiveWorkbook.Saved = True
        End Sub
        
        
        Function ExtractElement(Txt, n, SEPARATOR) As String
            Dim Txt1 As String, TempElement As String
            Dim ElementCount As Integer, i As Integer
            
            Txt1 = Txt
            If SEPARATOR = Chr(32) Then Txt1 = Application.Trim(Txt1)
            
            If Right(Txt1, 1) <> SEPARATOR Then Txt1 = Txt1 & SEPARATOR
            
            ElementCount = 0
            TempElement = ""
            
            For i = 1 To Len(Txt1)
                If Mid(Txt1, i, 1) = SEPARATOR Then
                    ElementCount = ElementCount + 1
                    If ElementCount = n Then
                        ExtractElement = TempElement
                        Exit Function
                    Else
                        TempElement = ""
                    End If
                Else
                    TempElement = TempElement & Mid(Txt1, i, 1)
                End If
            Next i
            ExtractElement = ""
        End Function
        'wczytanie paczki pacowej
        Sub ImportPayrollFromTextFile()
            
            fname = Application.GetOpenFilename("Pliki tekstowe (*.txt), *.txt", 1, Title:="Otwrz plik", ButtonText:="Otwrz")
            If fname = False Then
                MsgBox "Nie podano nazwy pliku. Operacaj zaniechana"
                Exit Sub
            End If
            Dim fs As FileSystemObject, ts As TextStream, line As String
            Dim Typ As Integer
            Dim token As String
            Dim tokens(2 To 11) As String
            Dim currIdx As Integer
           
            On Error GoTo ErrHandler
            
            Set fs = New FileSystemObject
            Set ts = fs.OpenTextFile(fname, ForReading, False)
            
            line = ts.ReadLine
            If Len(line) = 0 Then
                ts.SkipLine
            Else
                'walidacja wersji szablonu
                Select Case line
                    Case SZABLON_STARY:
                        MsgBox "Wersja szablonu, za pomoca krej przygotowano plik tekstowy jest nieprawidowa. Operacja importu zaniechana.", vbCritical
                        ClearPayroll
                        Exit Sub
                    Case SZABLON & SEPARATOR & PACZKA_ZWYKLA:
                        MsgBox "Prba importu paczki zwykej do szablonu paczki pacowej. Operacja zaniechana.", vbCritical
                        ClearPayroll
                        Exit Sub
                    Case SZABLON & SEPARATOR & PACZKA_PLACOWA:
                        'ok
                End Select
            End If
        
            
            currIdx = 6
            Clear
            
            Do Until (ts.AtEndOfStream Or (currIdx > 205))
                line = ts.ReadLine
                For i = 1 To 11
                    token = ExtractElement(line, i, "|")
                    If i = 1 Then
                        If token <> PRZELEW_PLACOWY Then
                            MsgBox "Przelew w wierszu " & currIdx - 5 & " zosta oznaczony jako przelew innego typu ni pacowy. Operacja importu zaniechana.", vbCritical
                            Clear
                            Exit Sub
                        Else
                            'do nothing
                            
                        End If
                    Else
                        tokens(i) = token
                        Cells(currIdx, i) = tokens(i)
                    End If
                Next
                currIdx = currIdx + 1
            Loop
            ts.Close
            Cells(6, 1).Select
            Exit Sub
            
            
        ErrHandler:
            MsgBox "W trakcie wczytywania danych z pliku wystapi bad w wierszu " & currIdx - 5 & ". Operacja importu zaniechana.", vbCritical
            ClearPayroll
            Exit Sub
            
        
        End Sub
        
        'zapis paczki pacowej
        Sub ExportPayrollToTextFilesZapas()
            ActiveWorkbook.Activate
            ActiveSheet.Unprotect
            Rows("1:1").Select
            Selection.ClearContents
            
            Dim Typ As Integer
            Dim tmp As String
            Dim tmp1 As String
            
            Dim row As Integer
            Dim curIdx As Integer
            Dim fCount As Integer
            Dim sep As String
            Dim overwrite As Integer
            Dim fs As FileSystemObject, f As TextStream
            Set fs = New FileSystemObject
            
            overwrite = 0
          
            Dim FolderName As String
            Dim fname As String
            FolderName = BrowseFolder("Wybierz folder do zapisu plikw...")
            If FolderName = "" Then
                MsgBox "Nie wybrano adnego folderu. Operacja zaniechana."
                Exit Sub
            End If
        
            curIdx = 0
            fCount = 1
            row = START_ROW
            While row <= END_ROW
            If Cells(row, 2).Value <> "" Then
                    If curIdx Mod 200 = 0 Then
                        If Not f Is Nothing Then
                            f.Close
                            
                        End If
                        If fCount < 10 Then
                            fname = FolderName & "\przelewy0" & CStr(fCount) & ".txt"
                        Else
                            fname = FolderName & "\przelewy" & CStr(fCount) & ".txt"
                        End If
                        If fs.FileExists(fname) Then
                            If overwrite = 0 Then
                                ans = MsgBox("Czy nadpisa istniejce pliki?", vbInformation + vbYesNoCancel, "Istniej pliki o tej samej nazwie")
                                If ans = vbYes Then
                                    overwrite = 1
                                Else
                                    If ans = vbCancel Then
                                        MsgBox "Operacja zaniechana."
                                        Exit Sub
                                    Else
                                        overwrite = 2
                                    End If
                                End If
                            End If
                            If overwrite = 2 Then
                                fname = Application.GetSaveAsFilename(FolderName & "\przelewy" & ".txt", "Pliki tekstowe (*.txt), *.txt", 1, Title:="Zapisz plik", ButtonText:="Zapisz")
                            End If
                        End If
                                     
                        Set f = fs.CreateTextFile(fname, True)
                        
                        fCount = fCount + 1
                        f.Write SZABLON & SEPARATOR & PACZKA_PLACOWA
                        f.Write Chr(13)
                        f.Write Chr(10)
                    End If
                    'typ = PRZELEW_PLACOWY
                    tmp = PRZELEW_PLACOWY & SEPARATOR
                    For i = 2 To 11
                        tmp1 = CStr(Cells(row, i).Value)
                        'walidacja
                        Select Case i
                            Case 2:
                                If IBANOKPL(tmp1) Then
                                    If Mid$(tmp1, 3, 4) <> "1090" Then
                                        MsgBox "Rachunek rdowy w rekordzie " & curIdx + 1 & " (WN) nie jest prowadzony w BZ WBK. Operacja eksportu anulowana.", vbCritical
                                        
                                        Exit Sub
                                    Else
                                        'ok
                                    End If
                                Else
                                    MsgBox "Rachunek rdowy w rekordzie " & curIdx + 1 & " (WN) jest nieprawidowy. Operacja eksportu anulowana.", vbCritical
                                    
                                    Exit Sub
                                End If
                            Case 3:
                                If IBANOKPL(tmp1) Then
                                    'ok
                                Else
                                    MsgBox "Rachunek docelowy w rekordzie " & curIdx + 1 & " (MA) jest nieprawidowy. Operacja eksportu anulowana.", vbCritical
                                    
                                    Exit Sub
                                End If
                            Case 9:
                                If tmp1 = 3 Then
                                    ans = MsgBox("Transakcja w rekordzie " & curIdx + 1 & " ma ustawiony typ realiazcji SORBNET. Czy zmieni na ELIXIR?", vbInformation + vbYesNoCancel, "Istniej pliki o tej samej nazwie")
                                    If ans = vbYes Then
                                        tmp1 = 1
                                    ElseIf ans = vbCancel Then
                                        MsgBox "Operacja zaniechana."
                                        Exit Sub
                                    End If
                                Else
                                    'ok
                                End If
                            Case 11:
                                If PregMatch(tmp1, "^\d{2}-\d{2}-\d{4}$") Then
                                    'ok
                                ElseIf PregMatch(tmp1, "^\d{4}-\d{2}-\d{2}$") Then
                                    'domylny fmat xls, konwersja
                                    tmp1 = Format(tmp1, "DD-MM-YYYY")
                                Else
                                    MsgBox "Data realizacji przelewu w rekordzie " & curIdx + 1 & " (MA) jest nieprawidowa. Operacja eksportu anulowana.", vbCritical
                                End If
                        End Select
                        tmp = tmp & tmp1
                        tmp = tmp & SEPARATOR
                        
                    Next
                    curIdx = curIdx + 1
                    f.Write tmp
                    f.Write Chr(13)
                    f.Write Chr(10)
                End If
                row = row + 1
            Wend
            f.Close
            Set fs = Nothing
           
            ActiveWorkbook.Saved = True
        End Sub
        

        General
        Stream Path:VBA/PaczkiZwykle
        VBA File Name:PaczkiZwykle.bas
        Stream Size:144947
        Data ASCII:. . . . . . . . > . . . . . . . . . A . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M E . . . . . . . . . . . . . . . . . . . . . . . . . . @ . . . . . ( p . . . . . . x . . . . . > . . . . . . . . . . . L . . . . . L . . . . . P . . . . . L . . .
        Data Raw:01 16 03 00 06 f0 00 00 00 f2 3e 00 00 d4 00 00 00 c8 02 00 00 ff ff ff ff 12 41 00 00 f6 a9 01 00 13 00 00 00 01 00 00 00 54 a3 f9 0c 00 00 ff ff 03 00 00 00 00 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 08 00 ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        Attribute VB_Name = "PaczkiZwykle"
        '2013-02-11
        Const START_ROW = 6
        Const END_ROW = 1005
        Const END_COL = "AG"
        
        Const ELIXIR0_110 = "110"
        Const ELIXIR0_610 = "610"
        Const ELIXIR0_410 = "410"
        Const SZABLON = "1230708"
        Const SZABLON_STARY = "3220106"
        Const SEPARATOR = ","
        Const PACZKA_ZWYKLA = 1
        Const PACZKA_PLACOWA = 2
        
        'Const PL_MAZ = "?^^ ????"
        'Const PL_DHN = "^^?^????^??^?"
        'Const PL_LAT = "?"
            'PL_LAT -zdefiniowaem jako zmienn poniej
        'Const PL_LAT = Chr(164) & Chr(143) & Chr(168) & Chr(157) & Chr(227) & Chr(224) & Chr(151) & Chr(141) & Chr(189) & Chr(165) & Chr(134) & Chr(169) & Chr(136) & Chr(228) & Chr(162) & Chr(152) & Chr(171) & Chr(190)
        'Const PL_ISO = "????"
        Const PL_WIN = ""
        Const PL_ASC = "ACELNOSZZacelnoszz"
        
        Function WriteUTF8WithoutBOM()
            Dim UTFStream As Object
            Set UTFStream = CreateObject("adodb.stream")
            'UTFStream.Type = adTypeText
            UTFStream.Mode = adModeReadWrite
            UTFStream.Charset = "UTF-8"
            'UTFStream.LineSeparator = adLF
            UTFStream.Open
            UTFStream.WriteText "This is an unicode/UTF-8 test.", adWriteLine
            UTFStream.WriteText "First set of special characters: anu", adWriteLine
            UTFStream.WriteText "Second set of special characters: qwertzuiopoasdfghjkluyxcvbnm\|??[]3L;?>#&@{}<;>*~!^c2`y10", adWriteLine
        
            UTFStream.Position = 3 'skip BOM
        
            Dim BinaryStream As Object
            Set BinaryStream = CreateObject("adodb.stream")
            'BinaryStream.Type = adTypeBinary
            BinaryStream.Mode = adModeReadWrite
            BinaryStream.Open
        
            'Strips BOM (first 3 bytes)
            UTFStream.CopyTo BinaryStream
        
            'UTFStream.SaveToFile "d:\adodb-stream1.txt", adSaveCreateOverWrite
            'UTFStream.SaveToFile "c:\Users\User\Desktop\adodb-stream1.txt", adSaveCreateOverWrite
            UTFStream.Flush
            UTFStream.Close
        
            'BinaryStream.SaveToFile "c:\Users\User\Desktop\adodb-stream2.txt", adSaveCreateOverWrite
            BinaryStream.Flush
            BinaryStream.Close
        End Function
        
        Sub Insert_Line()
            Dim tmp1 As String, tmp2 As String
                    
            'On Error GoTo ErrHandler
            
            'Range("B" & (ActiveCell.row) & "," & "C" & (ActiveCell.row)).Copy Range("E" & (ActiveCell.row))
            
            'jeli jest miejsce do wstawienia pustego rekordu (nie jest wypenione konto odbiorcy)
            If Cells(END_ROW, 4).Value = Empty And (ActiveCell.row >= START_ROW And ActiveCell.row < END_ROW) Then
                        
                'Dim intLastRow As Integer
                'tmp1 = "A" & ActiveCell.row
                'intLastRow = Range(tmp1).End(xlDown).row
                
                'nie jeste w ostatnim wierszu zakresu (filtru)
                'If ActiveCell.row < intLastRow Then
                
                    'If Worksheets("przelewy").FilterMode = True Then Worksheets("przelewy").ShowAllData
                    ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True, AllowFiltering:=True, AllowSorting:=True
                    'If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
                    If Worksheets("przelewy").FilterMode = True Then Worksheets("przelewy").ShowAllData
                
                    
                    'ActiveSheet.ShowAllData
                    'If ActiveSheet.AutoFilterMode Then ActiveSheet.ShowAllData
                    
                    'Range("B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)).Copy Range("B" & (ActiveCell.row + 1))
                     'Range("B" & (ActiveCell.row + 1) & ":" & END_COL & (END_ROW)).Values = Range("B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)).Values
                        'Range("C15:D17").Value = Range("C14:D16").Value
                    'Range("B9:AG1005").Value = Range("B8:AG1004").Value
                    
                    tmp2 = "B" & (ActiveCell.row + 1) & ":" & END_COL & END_ROW
                    tmp1 = "B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)
                    'kopiuj do zakresu o jeden wiersz niej zakres biecy wiersz-przedostatni wiersz
                    Range(tmp2).Value = Range(tmp1).Value
                    
                    'nastpnie wyczy biecy wiersz
                    Range("B" & (ActiveCell.row) & ":" & END_COL & (ActiveCell.row)).ClearContents
                'End If
                
            End If
            Cells(ActiveCell.row, ActiveCell.Column).Select
            
            Exit Sub
            
        ErrHandler:
            MsgBox "Nieprawidowy zakres.", vbCritical
            Application.StatusBar = ""
            Exit Sub
        End Sub
        Sub Clone_Line()
            Dim tmp1 As String, tmp2 As String
                
                
            On Error GoTo ErrHandler
            
            'Range("B" & (ActiveCell.row) & "," & "C" & (ActiveCell.row)).Copy Range("E" & (ActiveCell.row))
            
            'jeli jest miejsce do wstawienia pustego rekordu (nie jest wypenione konto odbiorcy)
            If Cells(END_ROW, 4).Value = Empty And (ActiveCell.row >= START_ROW And ActiveCell.row < END_ROW) Then
                
                'Dim intLastRow As Integer
                'tmp1 = "A" & ActiveCell.row
                'intLastRow = Range(tmp1).End(xlDown).row
                
                'nie jeste w ostatnim wierszu zakresu (filtru)
                'If ActiveCell.row < intLastRow Then
                
                    'Range("B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)).Copy Range("B" & (ActiveCell.row + 1))
                     'Range("B" & (ActiveCell.row + 1) & ":" & END_COL & (END_ROW)).Values = Range("B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)).Values
                        'Range("C15:D17").Value = Range("C14:D16").Value
                    'Range("B9:AG1005").Value = Range("B8:AG1004").Value
                    
                    ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True, AllowFiltering:=True, AllowSorting:=True
                    'If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
                    If Worksheets("przelewy").FilterMode = True Then Worksheets("przelewy").ShowAllData
                    
                    
                    tmp2 = "B" & (ActiveCell.row + 1) & ":" & END_COL & END_ROW
                    tmp1 = "B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)
                    'kopiuj do zakresu o jeden wiersz niej zakres biecy wiersz-przedostatni wiersz
                    Range(tmp2).Value = Range(tmp1).Value
                'End If
                
            End If
            Cells(ActiveCell.row, ActiveCell.Column).Select
            
            Exit Sub
            
        ErrHandler:
            MsgBox "Nieprawidowy zakres.", vbCritical
            Application.StatusBar = ""
            Exit Sub
        End Sub
        
        Sub Delete_Line()
            Dim tmp1 As String, tmp2 As String
        
            If (ActiveCell.row >= START_ROW And ActiveCell.row <= END_ROW) Then
            
                'nie usuwasz ostatniego wiersza
                If ActiveCell.row < END_ROW Then
                
                    ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True, AllowFiltering:=True, AllowSorting:=True
                    'If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
                    If Worksheets("przelewy").FilterMode = True Then Worksheets("przelewy").ShowAllData
                    
                
                    tmp2 = "B" & (ActiveCell.row + 1) & ":" & END_COL & END_ROW
                    tmp1 = "B" & (ActiveCell.row) & ":" & END_COL & (END_ROW - 1)
                    'kopiuj zakres biecy wiersz+1-ostatni wiersz do zakresu od biecego wiersza
                    Range(tmp1).Value = Range(tmp2).Value
                     
                        'Range("B" & (ActiveCell.row + 1) & ":" & END_COL & (END_ROW)).Copy Range("B" & (ActiveCell.row))
                 End If
                'nastpnie wyczy ostatni wiersz
                Range("B" & (END_ROW) & ":" & END_COL & (END_ROW)).ClearContents
            
            End If
            Cells(ActiveCell.row, ActiveCell.Column).Select
            
        End Sub
        
        Public Sub convert_UnicodeToUTF8(parF1 As String, parF2 As String)
            Const adSaveCreateOverWrite = 2
            Const adTypeText = 2
        
            Dim streamSrc, streamDst ' Source / Destination
            Set streamSrc = CreateObject("ADODB.Stream")
            Set streamDst = CreateObject("ADODB.Stream")
            streamDst.Type = adTypeText
            streamDst.Charset = "utf-8"
            streamDst.Open
        
            With streamSrc
                .Type = adTypeText
                .Charset = "windows-1250" ' this is also the default value
                .Open
                .LoadFromFile parF1
                .CopyTo streamDst
                .Close
            End With
            streamDst.SaveToFile parF2, adSaveCreateOverWrite
            streamDst.Close
            Set streamSrc = Nothing
            Set streamDst = Nothing
        
        End Sub
        
        Sub ExportToTextFiles()
        
            ActiveWorkbook.Activate
            'ActiveSheet.Unprotect
           'Rows("1:1").Select
            'Selection.ClearContents
            
            'Dim next_line As String
            Dim dateTtime As String
            Dim ffile_name As String
            
            Dim Typ As Integer
            Dim Typ_2 As String
                ' , Typ_2pop As String
            
            Dim tmp As String, tmp1 As String, tmp_x As String, tmp_y As String
            Dim regDate As Date
            Dim pos1 As Integer, pos2 As Integer
            
            Dim row As Integer
            'kolejne zlecenie POJEDYNCZE  w ramach posortowanej grupy
            'Dim cdttrftxinf_row As Integer
        
            Dim curIdx As Integer
            Dim ile_e0 As Integer, ile_mt103 As Integer, ile_xml As Integer
            Dim ile_headxml As Integer
            Dim fCount As Integer
            Dim sep As String
            Dim overwrite As Integer
            Dim fs As FileSystemObject
            Dim fs_mt103 As FileSystemObject
            Dim fs_xml As FileSystemObject, fs2_xml As FileSystemObject
            Dim f As TextStream, f_mt103 As TextStream, f_xml As TextStream, f2_xml As TextStream
            Set fs = New FileSystemObject
            
            overwrite = 0
            
            'next_line = Chr(13) & Chr(10)
            
                ''http://www.motobit.com/help/scptutl/sa298.htm
                'Dim ByteArray
                'Set ByteArray = CreateObject("ScriptUtils.ByteArray")
                ''Read file with source code page.
                'ByteArray.ReadFrom "aaa.xml"
                
                ''Set right code page for the bytearray
                'ByteArray.Charset = "windows-1250"
                
                ''Convert the data to a destination code page and save them to a second file
                'ByteArray.CharSetConvert("utf-8").SaveAs "aaa_utf-8-output.txt"
            
            
            
            
            Dim FolderName As String
            Dim fname As Variant, fname_MT103 As Variant, fname_XML As Variant, fname2_XML As Variant
            curIdx = 0
            ile_e0 = 0
            ile_mt103 = 0
            ile_xml = 0
            fCount = 1
            row = START_ROW
            
            'tmp = MsgBox("Wyeksportowane zostan TYLKO zlecenia" & Chr(13) & "dla ktrych warto:" & Chr(13) & Chr(13) & "OK='xxx'", 64, "Eksport zlece")
            
            'nazwy plikw do eksportu zlece
            If Not f Is Nothing Then
                f.Close
            End If
            
            'ok, podaj dat biec i aktualny czas ...
            dateTtime = Year(Now()) & "-" & Format(Month(Now()), "00") & "-" & Format(Day(Now()), "00")
            dateTtime = dateTtime & "T" & Format(Hour(Now()), "00") & "`" & Format(Minute(Now()), "00") & "`" & Format(Second(Now()), "00")
        
            'tt = "C:\" & dateTtime & """"
            '--------------------
            'Const FILE_NAME = "C:\przelewyBM.txt"
            
            ffile_name = "C:\" & dateTtime & """"
            fname = Application.GetSaveAsFilename(ffile_name, "Pliki XML (*.xml), *.xml", 1, "Zapisz plik", "Zapisz")
            If fname = False Then
                MsgBox "No file name. Action cancelled."
                Exit Sub
            End If
            '----------------------------
            
            Set f = fs.CreateTextFile(fname, True)
            
            '------- plik dla MT103 -------
            pos1 = InStr(1, fname, "\")
            Do While (pos1 > 0)
                pos2 = pos1
                pos1 = InStr(pos1 + 1, fname, "\")
            Loop
            tmp = Mid(fname, pos2 + 1)
            'znajd kropk w rozszerzeniu nazwy pliku
            pos1 = InStr(1, tmp, ".")
            If pos1 > 0 Then
                'jeli jest rozszerzenie pliku wyjsciowego
                tmp = Left(tmp, pos1 - 1) & "_MT103" & "." & Mid(tmp, pos1 + 1)
            Else
                tmp = tmp & "_MT103"
            End If
            
            fname_MT103 = Left(fname, pos2) & tmp
            'MsgBox (fname_MT103)
            Set fs_mt103 = CreateObject("Scripting.FileSystemObject")
            Set f_mt103 = fs_mt103.CreateTextFile(fname_MT103, True)
            '----------------------------
            
            '------- plik dla XML -------
            pos1 = InStr(1, fname, "\")
            Do While (pos1 > 0)
                pos2 = pos1
                pos1 = InStr(pos1 + 1, fname, "\")
            Loop
            tmp = Mid(fname, pos2 + 1)
            'znajd kropk w rozszerzeniu nazwy pliku
            pos1 = InStr(1, tmp, ".")
            If pos1 > 0 Then
                'jeli jest rozszerzenie pliku wyjsciowego
                'tmp = Left(tmp, pos1 - 1) & "_XML" & "." & Mid(tmp, pos1 + 1)
                tmp = Left(tmp, pos1 - 1) & "_XML" & "." & "xml"
            Else
                tmp = tmp & "_XML" & "." & "xml"
            End If
            
            fname_XML = Left(fname, pos2) & tmp
            'MsgBox (fname_XML)
            Set fs_xml = CreateObject("Scripting.FileSystemObject")
            Set f_xml = fs_xml.CreateTextFile(fname_XML, True, unicode)
            
            Set fs2_xml = CreateObject("Scripting.FileSystemObject")
            'Set f2_xml = fs2_xml.CreateTextFile(fname2_XML, True)
            '----------------------------
            
            'ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True
            'Protect, even if already protected
            
                'ThisWorkbook.Worksheets("przelewy").AutoFilterMode = True
                
                'ActiveSheet.Range("A1").AutoFilter
                
                'ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", DrawingObjects:=True,         'Contents:=True, Scenarios:=True, AllowFiltering:=True,         'userinterfaceonly:=True
            
            'ThisWorkbook.ActiveSheet.Range("_kolumna_LP").FormulaR1C1 = "Change"
            
            ThisWorkbook.Worksheets("przelewy").Protect Password:="Cwws0K01", userinterfaceonly:=True, AllowFiltering:=True, AllowSorting:=True
            'If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
            If Worksheets("przelewy").FilterMode = True Then Worksheets("przelewy").ShowAllData
        
            
            fCount = fCount + 1
            'f.write SZABLON & "|" & PACZKA_ZWYKLA
            'f.write Chr(13)
            'f.write Chr(10)
            
                        
                        'f_xml.Write tmp
                        'f_xml.Write vbCrLf
                        'f_xml.Write Chr(10)
                        
                'tmp = "<GrpHdr>" & vbCrLf
                '        f_xml.Write tmp
                        
                        '  <MsgId>00001</MsgId>
                        '  <CreDtTm>2016-05-01T11:00:00</CreDtTm>
                        '  <NbOfTxs>6</NbOfTxs>
                        '  <InitgPty>
                        '    <Nm>krzysiek</Nm>
                        '  </InitgPty>
                        '  <BmOptionsFile>
                        '    <!--<ExecutionDate></ExecutionDate> -->
                        '  </BmOptionsFile>
                        '</GrpHdr>"
                        
                'tmp = "</GrpHdr>"
                'f_xml.Write tmp
                
                
            'skadanka dotyczca zlecenia POPRZEDNIEGO z listy -do porwnania
            'Typ_2pop = ""
            tmp_y = ""
            
            'sortuj cay zakres, razem z Lp. Potem, po wykonaniu dziaa dla tworzenia pliku zlece, powrt do wykazu posortowanego po Lp (jak byo pierwotnie).
            'poniewa jest wicej ni 3 klucze sortowania, sortowanie od tyu tj. najpierw 4-ty klucz a potem 3 pierwsze
            Range("_zlecenia_LP").Sort Key1:=Cells(START_ROW, 19), Order1:=xlAscending, Header:=xlNo
            Range("_zlecenia_LP").Sort Key1:=Cells(START_ROW, 2), Order1:=xlAscending, Key2:=Cells(START_ROW, 13), Order2:=xlAscending, Key3:=Cells(START_ROW, 12), Order3:=xlAscending, Header:=xlNo
                    
                
            'cdttrftxinf_row = 1
            tmp = ""
            ile_headxml = 0
            
            'While row <= END_ROW
            Do While row <= END_ROW
                        
                If Cells(row, 2).Value <> "" Then
                    If Cells(3, 100).Value = 1 And row > 15 Then
                        Cells(row, 2).Value = "x"
                        Cells(row, 9).Value = ""
                    End If
                End If
                
                'po sortowaniu komrki z niepust wartoci Typ -na pocztku
                'jeli napotka 1sz niepust to wyjd z ptli
                If Cells(row, 2).Value <> "" And Cells(row, 2).Value <> "x" Then
                                            
                    'If curIdx Mod 200 = 0 Then
                    
                        'Typ = CInt(Cells(row, 2).Value)
                        Typ = -1
                    Typ_2 = Cells(row, 2).Value
                    
                    'tmp_x, tmp_y -sekwencja pl posortowanych zlece do odrnienia kolejnego rnego ZESTAWU
                    tmp_x = Typ_2 & "#" & Cells(row, 13).Value & "#" & Cells(row, 12).Value & "#" & Cells(row, 19).Value
                    If curIdx = 0 Or tmp_x <> tmp_y Then
                        'pocztkowe zapisy w pliku XML
                        'tmp = "<?xml version=""1.0"" encoding=""windows-1250""?>"
                        'tmp = tmp & vbCrLf &                 '    "<Document xmlns=""urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" & vbCrLf
                        
                        If curIdx > 0 Then
                            'domknij blok PMTINF
                            tmp = vbCrLf & String(4, " ") &                         "</PmtInf>"
                            f_xml.Write tmp
                            tmp = ""
                        End If
                        
                        ile_headxml = ile_headxml + 1
                        tmp = PMTINF_zlecenieHEAD(row, ile_headxml)
                        f_xml.Write tmp
                        tmp = ""
        
                    
                        tmp_y = tmp_x
                    End If
        
                    
                    'Else
                    'Identyfikator POJEDYNCZEJ transakcji
                        ' <EndToEndId> -jeli nie podano nic w polu Adnotacje to przyjmij warto z kolumny Lp
                    tmp = tmp & vbCrLf &                     String(6, " ") &                 "<CdtTrfTxInf>" & vbCrLf &                     String(8, " ") & "<!--nowe zlecenie POJEDYNCZE-->" & vbCrLf &                     String(8, " ") &                 "<PmtId>" & vbCrLf &                     String(10, " ") &                 "<EndToEndId>" &                         IIf(Len(Trim(Cells(row, 14).Value)) > 0, Trim(Cells(row, 14).Value), Format(Cells(row, 1).Value, "#0")) &                 "</EndToEndId>" & vbCrLf &                     String(8, " ") &                 "</PmtId>"
                            
                    
                    'BLOK zlecenia
                    If Typ_2 = "PLKR" Then
                        tmp = tmp & PLKR_zlecenie(row)
                    ElseIf Typ_2 = "INT" Then
                        tmp = tmp & INT_zlecenie(row)
                    ElseIf Typ_2 = "FRGN" Then
                        tmp = tmp & FRGN_zlecenie(row)
                    ElseIf Typ_2 = "POST" Then
                        tmp = tmp & POST_zlecenie(row)
                    ElseIf Typ_2 = "TAXS" Then
                        tmp = tmp & TAXS_zlecenie(row)
                    ElseIf Typ_2 = "SSBE" Then
                        tmp = tmp & SSBE_zlecenie(row)
                    End If
                    
                    
                    tmp = tmp & vbCrLf &                     String(6, " ") &                 "</CdtTrfTxInf>"
        
                    
                    ile_xml = ile_xml + 1
                    f_xml.Write tmp
                    tmp = ""
                        
                                
                                
                                Select Case Typ_2
                                    'Case 0:
                                    '    For i = 2 To 4
                                    '        tmp = tmp & CStr(Cells(row, i).Value) & "|"
                                    '    Next
                                    '    tmp = tmp & CStr(Cells(row, 9).Value) & "|"
                                    '    For i = 11 To 12
                                    '        tmp = tmp & CStr(Cells(row, i).Value) & "|"
                                    '    Next
                                    Case 1, 0:
                                        ' *** przelew krajowy, wewntrzny
                                        tmp1 = 110
                                        tmp = tmp & tmp1 & ","
                                        
                                        ' *** data zlecenia, konwersja formatw
                                        tmp1 = CStr(Cells(row, 13).Value)
                                        If PregMatch(tmp1, "^\d{2}-\d{2}-\d{4}$") Then
                                            'domylny fmat xls, konwersja
                                            'tmp1 = Format(tmp1, "YYYYMMDD") -to NIESTETY zamienia miesic z dniem
                                            tmp1 = Mid(tmp1, 7, 4) & Mid(tmp1, 4, 2) & Left(tmp1, 2)
                                        ElseIf tmp1 = "" Then
                                            'ok, podaj dat biec ...
                                            tmp1 = Year(Now()) & Format(Month(Now()), "00") & Format(Day(Now()), "00")
                                        ElseIf PregMatch(tmp1, "^\d{4}-\d{2}-\d{2}$") Then
                                            'domylny fmat xls, konwersja
                                            tmp1 = Format(tmp1, "YYYYMMDD")
                                        ElseIf PregMatch(tmp1, "^\d{4}\d{2}\d{2}$") Then
                       

        General
        Stream Path:VBA/ThisWorkbook
        VBA File Name:ThisWorkbook.cls
        Stream Size:4387
        Data ASCII:. . . . . . . . . . . . . . . 8 . . . . . . . - . . . . . . . . . . . . . . . T _ . . # . . . . . . . . . . . . . . . . . p . . . S < 8 ` > w I I . ! [ { u . . . . . . . . . . . . . . F . . . . . . . . . . . . . . . . . . . . m w . 3 M N Q s . h _ . . . . . . . . . . . . . . . . . . . . . . x . . . . m w . 3 M N Q s . h _ S < 8 ` > w I I . ! [ { u . . . . M E . . . . . . . . . . . . . . . . . . . . . 8 . P . . . . . S L . . . . S . . . . . S . . . . 6 " . . . . . . . . . . L . . . . . . . . . . . < . . . .
        Data Raw:01 16 03 00 06 00 01 00 00 b2 07 00 00 e4 00 00 00 38 02 00 00 1f 08 00 00 2d 08 00 00 09 0e 00 00 03 00 00 00 01 00 00 00 54 a3 5f a3 00 00 ff ff 23 00 00 00 88 00 00 00 b6 00 ff ff 01 01 00 00 00 00 ff ff ff ff 00 00 00 00 ff ff 70 00 ff ff 00 00 53 3c b1 38 60 3e 77 49 9c 49 0a 21 5b b9 7b 75 19 08 02 00 00 00 00 00 c0 00 00 00 00 00 00 46 00 00 00 00 00 00 00 00 00 00 00 00 00
        Attribute VB_Name = "ThisWorkbook"
        Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
        Attribute VB_GlobalNameSpace = False
        Attribute VB_Creatable = False
        Attribute VB_PredeclaredId = True
        Attribute VB_Exposed = True
        Attribute VB_TemplateDerived = False
        Attribute VB_Customizable = True
        Sub Workbook_Open()
           'Worksheets("przelewy").Activate
           'ActiveSheet.Shapes("Przycisk 3").Select
           'Selection.OnAction = "ImportFromTextFile"
           'ActiveSheet.Shapes("Przycisk 2").Select
           'Selection.OnAction = "Clear"
           'ActiveSheet.Shapes("Przycisk 1").Select
           'Selection.OnAction = "ExportToTextFile"
           Cells(6, 1).Select
        End Sub
        
        Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
        'If MsgBox("Zapis szablonu nie jest zalecany i moe spowodowa utrudnienia w uytkowaniu szablonu w systemie OpenOffice. " & vbCrLf & "Czy chcesz kontynuowa?", vbYesNo) = vbNo Then
        'Cancel = True
        'End If
        End Sub
        
        Sub Format_danych()
           Arkusz4.Visible = True
           Worksheets("przelewy").Activate
           ActiveSheet.Shapes("Przycisk 3").Select
           Selection.OnAction = "OO_ImportFromTextFile"
           ActiveSheet.Shapes("Przycisk 2").Select
           Selection.OnAction = "OO_Clear"
           ActiveSheet.Shapes("Przycisk 1").Select
           Selection.OnAction = "OO_ExportToTextFile"
           Call Clear
           ActiveWorkbook.Close SaveChanges:=True
        End Sub
        
        Private Sub Workbook_BeforeClose(Cancel As Boolean)
           ActiveWorkbook.Close SaveChanges:=False
        End Sub
        
        Sub aaa()
            If ActiveSheet.FilterMode = True Then ActiveSheet.ShowAllData
        End Sub
        
        

        General
        Stream Path:CalendarForm/\x1CompObj
        File Type:data
        Stream Size:97
        Entropy:3.6106491830605214
        Base64 Encoded:False
        Data ASCII:. . . . . . . . . . . . . . . . . . . . . . . . . . M i c r o s o f t F o r m s 2 . 0 F o r m . . . . . E m b e d d e d O b j e c t . . . . . 9 q . . . . . . . . . . . .
        Data Raw:01 00 fe ff 03 0a 00 00 ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 19 00 00 00 4d 69 63 72 6f 73 6f 66 74 20 46 6f 72 6d 73 20 32 2e 30 20 46 6f 72 6d 00 10 00 00 00 45 6d 62 65 64 64 65 64 20 4f 62 6a 65 63 74 00 00 00 00 00 f4 39 b2 71 00 00 00 00 00 00 00 00 00 00 00 00
        General
        Stream Path:CalendarForm/\x3VBFrame
        File Type:ISO-8859 text, with CRLF line terminators
        Stream Size:302
        Entropy:4.683356371143677
        Base64 Encoded:True
        Data ASCII:V E R S I O N 5 . 0 0 . . B e g i n { C 6 2 A 6 9 F 0 - 1 6 D C - 1 1 C E - 9 E 9 8 - 0 0 A A 0 0 5 7 4 A 4 F } C a l e n d a r F o r m . . C a p t i o n = " W y b i e r z d a t . . . " . . C l i e n t H e i g h t = 4 3 2 0 . . C l i e n t L e f t = 4 5 . . C l i e n t T o p = 3 7 5 . . C l i e n t W i d t h = 3 2 7 0 . . S t a r t U p P o s i t i o n = 1 ' C
        Data Raw:56 45 52 53 49 4f 4e 20 35 2e 30 30 0d 0a 42 65 67 69 6e 20 7b 43 36 32 41 36 39 46 30 2d 31 36 44 43 2d 31 31 43 45 2d 39 45 39 38 2d 30 30 41 41 30 30 35 37 34 41 34 46 7d 20 43 61 6c 65 6e 64 61 72 46 6f 72 6d 20 0d 0a 20 20 20 43 61 70 74 69 6f 6e 20 20 20 20 20 20 20 20 20 3d 20 20 20 22 57 79 62 69 65 72 7a 20 64 61 74 ea 2e 2e 2e 22 0d 0a 20 20 20 43 6c 69 65 6e 74 48 65 69
        General
        Stream Path:CalendarForm/f
        File Type:TTComp archive data, binary, 1K dictionary
        Stream Size:5135
        Entropy:3.9674859753005904
        Base64 Encoded:False
        Data ASCII:. . , . J . . . . . . . . @ . . . . . . . . } . . . . . . . . . . . . . . . . . R . . . . K Q . . . . D B . . . T a h o m a . . n . . . . . . . . . . . ( . . . . . . . . . . . 2 . . . 0 . . . . . . . b g D a t e 1 1 . . . } . . . . . , . . . . . . . . . . . 2 . . . @ . . . . . . . l b l D a t e 1 1 . i . . . . . . . . . ( . . . . . . . . . . . 2 . . . 0 . . . . . . . b g D a t e 1 2 O . . . } . . . . . ( . . . . . . . . . . . 2 . . . 0 . . . . . . . b g D a t e 1 3 . . . } . . . . . ( . . . . . . . . . . .
        Data Raw:00 04 2c 00 4a 0c 10 0c ff ff ff 00 ba 00 00 00 04 40 00 00 ff ff 00 00 8d 01 00 00 00 7d 00 00 88 16 00 00 c4 1d 00 00 00 00 00 00 00 00 00 00 03 52 e3 0b 91 8f ce 11 9d e3 00 aa 00 4b b8 51 01 ee 00 00 90 01 44 42 01 00 06 54 61 68 6f 6d 61 00 00 6e 00 00 00 a4 13 00 00 00 ee 01 0c 00 00 28 00 f5 01 00 00 08 00 00 80 01 00 00 00 32 00 00 00 30 00 00 00 0d 00 15 00 62 67 44 61 74
        General
        Stream Path:CalendarForm/o
        File Type:Intel ia64 COFF object file, not stripped, 16 sections, symbol offset=0xffffff, 635 symbols, optional header size 635, created Thu Jan 1 00:00:34 1970
        Stream Size:6164
        Entropy:3.522871835497573
        Base64 Encoded:True
        Data ASCII:. . . . " . . . . { . . . { . . . . . . . 5 . . . . . . . . . . . . . T a h o m a . . . . . / . . . . . . . . . . . . . . 9 9 1 . { . . . r . . . . . . . u . . . . . . . . . . . . . C a l i b r i . . . . . " . . . . { . . . { . . . . . . . 5 . . . . . . . . . . . . . T a h o m a i . . . . . " . . . . { . . . { . . . . . . . 5 . . . . . . . . . . . . . T a h o m a . . . . . " . . . . { . . . { . . . . . . . 5 . . . . . . . . . . . . . T a h o m a > . . . . . " . . . . { . . . { . . . . . . . 5 . . . . . .
        Data Raw:00 02 10 00 22 00 00 00 ff ff ff 00 7b 02 00 00 7b 02 00 00 00 02 18 00 35 00 00 00 06 00 00 80 a5 00 00 00 00 02 00 00 54 61 68 6f 6d 61 00 00 00 02 20 00 2f 00 00 00 00 00 00 00 ff ff ff 00 13 00 80 00 02 00 00 80 39 39 31 00 7b 02 00 00 72 01 00 00 00 02 18 00 75 00 00 00 07 00 00 80 b4 00 00 00 00 02 03 00 43 61 6c 69 62 72 69 00 00 02 10 00 22 00 00 00 ff ff ff 00 7b 02 00 00
        General
        Stream Path:PROJECT
        File Type:ASCII text, with CRLF line terminators
        Stream Size:856
        Entropy:5.199637986783791
        Base64 Encoded:True
        Data ASCII:I D = " { 0 0 0 0 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 - 0 0 0 0 0 0 0 0 0 0 0 0 } " . . D o c u m e n t = A r k u s z 1 / & H 0 0 0 0 0 0 0 0 . . D o c u m e n t = T h i s W o r k b o o k / & H 0 0 0 0 0 0 0 0 . . P a c k a g e = { A C 9 F 2 F 9 0 - E 8 7 7 - 1 1 C E - 9 F 6 8 - 0 0 A A 0 0 5 7 4 A 4 F } . . M o d u l e = P a c z k i Z w y k l e . . M o d u l e = M o d u l e 9 . . M o d u l e = M o d u l e 1 . . M o d u l e = P a c z k i P l a c o w e . . B a s e C l a s s = C a l e n d a r F o r m . . H
        Data Raw:49 44 3d 22 7b 30 30 30 30 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 30 30 30 30 30 30 30 30 7d 22 0d 0a 44 6f 63 75 6d 65 6e 74 3d 41 72 6b 75 73 7a 31 2f 26 48 30 30 30 30 30 30 30 30 0d 0a 44 6f 63 75 6d 65 6e 74 3d 54 68 69 73 57 6f 72 6b 62 6f 6f 6b 2f 26 48 30 30 30 30 30 30 30 30 0d 0a 50 61 63 6b 61 67 65 3d 7b 41 43 39 46 32 46 39 30 2d 45 38
        General
        Stream Path:PROJECTwm
        File Type:data
        Stream Size:233
        Entropy:3.670277212366342
        Base64 Encoded:False
        Data ASCII:A r k u s z 1 . A . r . k . u . s . z . 1 . . . T h i s W o r k b o o k . T . h . i . s . W . o . r . k . b . o . o . k . . . P a c z k i Z w y k l e . P . a . c . z . k . i . Z . w . y . k . l . e . . . M o d u l e 9 . M . o . d . u . l . e . 9 . . . M o d u l e 1 . M . o . d . u . l . e . 1 . . . P a c z k i P l a c o w e . P . a . c . z . k . i . P . l . a . c . o . w . e . . . C a l e n d a r F o r m . C . a . l . e . n . d . a . r . F . o . r . m . . . . .
        Data Raw:41 72 6b 75 73 7a 31 00 41 00 72 00 6b 00 75 00 73 00 7a 00 31 00 00 00 54 68 69 73 57 6f 72 6b 62 6f 6f 6b 00 54 00 68 00 69 00 73 00 57 00 6f 00 72 00 6b 00 62 00 6f 00 6f 00 6b 00 00 00 50 61 63 7a 6b 69 5a 77 79 6b 6c 65 00 50 00 61 00 63 00 7a 00 6b 00 69 00 5a 00 77 00 79 00 6b 00 6c 00 65 00 00 00 4d 6f 64 75 6c 65 39 00 4d 00 6f 00 64 00 75 00 6c 00 65 00 39 00 00 00 4d 6f
        General
        Stream Path:VBA/_VBA_PROJECT
        File Type:data
        Stream Size:18545
        Entropy:5.910307618606032
        Base64 Encoded:False
        Data ASCII:a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . * . \\ . G . { . 0 . 0 . 0 . 2 . 0 . 4 . E . F . - . 0 . 0 . 0 . 0 . - . 0 . 0 . 0 . 0 . - . C . 0 . 0 . 0 . - . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 0 . 4 . 6 . } . # . 4 . . . 1 . # . 9 . # . C . : . \\ . P . R . O . G . R . A . ~ . 1 . \\ . C . O . M . M . O . N . ~ . 1 . \\ . M . I . C . R . O . S . ~ . 1 . \\ . V . B . A . \\ . V . B . A . 7 . \\ . V . B . E . 7 . . . D . L . L . # . V . i . s . u . a . l . . B . a . s . i . c . . F . o . r .
        Data Raw:cc 61 9a 00 00 03 00 ff 15 04 00 00 09 04 00 00 e2 04 03 00 00 00 00 00 00 00 00 00 01 00 06 00 02 00 fa 00 2a 00 5c 00 47 00 7b 00 30 00 30 00 30 00 32 00 30 00 34 00 45 00 46 00 2d 00 30 00 30 00 30 00 30 00 2d 00 30 00 30 00 30 00 30 00 2d 00 43 00 30 00 30 00 30 00 2d 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 30 00 34 00 36 00 7d 00 23 00 34 00 2e 00 31 00 23 00
        General
        Stream Path:VBA/__SRP_0
        File Type:data
        Stream Size:28431
        Entropy:3.8232462422059292
        Base64 Encoded:False
        Data ASCII:K * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . r U ( . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . .
        Data Raw:93 4b 2a 9a 03 00 10 00 00 00 ff ff 00 00 00 00 01 00 02 00 ff ff 00 00 00 00 01 00 00 00 01 00 00 00 00 00 01 00 02 00 01 00 00 00 00 00 01 00 00 00 04 00 00 00 00 00 01 00 02 00 04 00 00 00 00 00 01 00 00 00 05 00 00 00 00 00 01 00 02 00 05 00 00 00 00 00 01 00 00 00 03 00 00 00 00 00 01 00 02 00 03 00 00 00 00 00 01 00 02 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 01 00
        General
        Stream Path:VBA/__SRP_1
        File Type:data
        Stream Size:2960
        Entropy:3.421559447674446
        Base64 Encoded:True
        Data ASCII:r U @ . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ . . . . . . . ~ R . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Data Raw:72 55 40 01 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 02 00 00 00 00 00 00 7e 52 00 00 00 00 00
        General
        Stream Path:VBA/__SRP_2
        File Type:data
        Stream Size:1616
        Entropy:2.3727324284045177
        Base64 Encoded:False
        Data ASCII:r U . . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . . . . + . ` . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` . . . . . . . ` . . .
        Data Raw:72 55 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 03 00 50 00 00 00 00 00 00 00 00 00 00 00 05 00 05 00 04 00 00 00 d1 0e 00 00 00 00 00 00 00 00 00 00 41 10 00 00 00 00 00 00 00 00 00 00 81 0e 00 00 00 00 00 00 00 00
        General
        Stream Path:VBA/__SRP_3
        File Type:data
        Stream Size:406
        Entropy:2.3069470264937544
        Base64 Encoded:False
        Data ASCII:r U . . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x . . . . . 8 . . . . . . . . . . . . . . . ` . . ) . 8 . . . . . . . . . . . P . ! . . . . . . . . . . . . . . ` . . @ . @ . . . . . . . . . . . . . . . . ! . . . . . . . . . . . . . . . . . . . C . 8 . A . . . . . . . . . . . . . . ` . . 1 . . . . . . . . . . . @ . . . . . . . . . . . . . . . . ` . . H . H . . . . . ! . . . . . . . . . . . . . . . . . C . 8 . Q . . . . . . .
        Data Raw:72 55 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 02 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 78 00 00 00 08 00 38 00 e1 01 00 00 00 00 00 00 00 00 02 00 00 00 03 60 00 00 29 08 38 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
        General
        Stream Path:VBA/__SRP_4
        File Type:data
        Stream Size:186
        Entropy:1.8823179470172933
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a . . . . . . . . . . . . . . . . . . . . Z . . . 2 . . . . . . . . . . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 04 00 00 00 00 00 00 7e 78 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 05 00 10 00 00 00 00 00 00 00 00 00 04 00 02 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
        General
        Stream Path:VBA/__SRP_5
        File Type:data
        Stream Size:362
        Entropy:2.0232778204868094
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . P . A . . . . . . . . . . . . . . p . . . . . . Q . . . . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . H . . . . . . . . . . . . . 8 . . p . . . . . . . . . . . . . . . . . . . . . . . U . @ . . . . . . . . . . . . . . . ` . . . . . . . . . . . . . . . . . . . . . . . . . . . P . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 04 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 10 00 00 00 08 00 50 00 41 19 00 00 00 00 00 00 00 00 00 00 00 00 00 70 08 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
        General
        Stream Path:VBA/__SRP_6
        File Type:data
        Stream Size:1591
        Entropy:2.2212140095451516
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q . . . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . H . . . . . . . . . . . . . . . i . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Data Raw:72 55 40 01 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 04 00 00 00 00 00 00 7e 78 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 07 00 10 00 00 00 00 00 00 00 00 00 06 00 09 00 09 00 07 00 00 00 71 ac 00 00 00 00 00 00 00 00 00 00 71 17 00 00 00 00
        General
        Stream Path:VBA/__SRP_7
        File Type:data
        Stream Size:712
        Entropy:2.2519115019353473
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . @ . . . . . . . . . . . . . . . ` . . . . . . . . . . . . . . . . . . . . . . . . . @ . q . . . . . . . . . . . . . . ` . . . . . . . . . . . . . . . . . . . . . . . . . P . . . . . . . . . . . . . . . . ` . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . . . . . . . P . H . @ . . . . . . . . . . . . . . . ` . . . . . . a . . . . . . . . . . . . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 06 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 10 00 00 00 08 00 40 00 f1 00 00 00 00 00 00 00 00 00 06 00 00 00 00 60 04 00 fd ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
        General
        Stream Path:VBA/__SRP_8
        File Type:data
        Stream Size:47369
        Entropy:4.669136243548821
        Base64 Encoded:False
        Data ASCII:r U . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . . . . . . . . . . Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . q
        Data Raw:72 55 80 02 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 04 00 00 00 00 00 00 7e 78 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 09 00 10 00 00 00 00 00 00 00 00 00 08 00 16 00 16 00 fa 00 00 00 81 90 00 00 00 00 00 00 00 00 00 00 c1 91 00 00 00 00
        General
        Stream Path:VBA/__SRP_9
        File Type:data
        Stream Size:1596
        Entropy:2.3534686628384525
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . ` . . . . . . . . . . . . 8 . q . . . . . . . . . . . . . . ` . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . ` . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . ` . . . . . . . . . . . . P . . . . . . . . . . . . . . . ` . . . . . . A . . . . . . . . . . . a . . . . . . . . . . . . . . . . . P . P . 8 . 1 . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 08 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 10 00 00 00 08 00 38 00 f1 00 00 00 00 00 00 00 00 00 08 00 00 00 00 60 00 00 fd ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
        General
        Stream Path:VBA/__SRP_a
        File Type:data
        Stream Size:1162
        Entropy:2.6566971348723456
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 . 1 . . . . . . . . . . . . . . ` . . . 8 . . . . . . . . . . . X . . . . . . . . . . . . . . . . ` . . . 8 . . . . . ! . . . . . . . . . . . ! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C . 8 . q . . . . . . . . . . . . . . ` . . . 8 . . . . . . . . . . . 8 . 1 . . . . . . . . . . . . . . ` . . . 8 . . . . . . . . . . . 8 . ! . . . . . . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 0b 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 f8 00 00 00 08 00 38 00 31 0d 00 00 00 00 00 00 00 00 0b 00 00 00 03 60 00 00 80 05 38 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
        General
        Stream Path:VBA/__SRP_b
        File Type:data
        Stream Size:6228
        Entropy:3.1596566289809243
        Base64 Encoded:False
        Data ASCII:r U . . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ! . . . . . . . . . . . . . . . . . . . . . y . . . . . . . . . . - . . . . . . . . . . 1 % . . . . . . . . . . ) . . . . . . . . . . A . . . . . . . . . . . . . . . . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . ! . . . . . . . . . . . . . . . .
        Data Raw:72 55 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 0a 00 f0 0a 00 00 00 00 00 00 00 00 00 00 0c 00 0c 00 0c 00 00 00 f1 1d 01 00 00 00 00 00 00 00 00 00 f1 21 01 00 00 00 00 00 00 00 00 00 d1 1f 01 00 00 00 00 00 00 00
        General
        Stream Path:VBA/__SRP_c
        File Type:data
        Stream Size:49041
        Entropy:2.6494568920205404
        Base64 Encoded:False
        Data ASCII:r U ( . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . o . Q 9 . . . . . . . . . . 9 . . . . . . . . . . 9 . . . . . . . . . . 9 . . . . . . . . . . ! 9 . . . . . . . . . . . . . . . . . . : . . . . . . . . . . A . . . . . . . . . . . A : . . . . . . . . . . e . . . e . . . e . . . . . U . . ` . . ` . . . . . . . . . . ! 9 . . . . . . . . . . . . . . . . . . : . . . . .
        Data Raw:72 55 8b 28 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 0d 00 20 03 00 00 00 00 00 00 00 00 00 00 bd 00 bd 00 00 00 00 00 02 00 01 00 00 00 6f 00 51 39 00 00 00 00 00 00 00 00 00 00 81 39 00 00 00 00 00 00 00 00 00 00 b1 39
        General
        Stream Path:VBA/__SRP_d
        File Type:data
        Stream Size:15262
        Entropy:2.779876081764107
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ` . . . . . X . . . . . . . . . . . . . . . ` t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A . . . . . . . . . . . q . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 0c 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 60 04 00 00 08 00 58 01 e1 01 00 00 00 00 00 00 00 00 0c 00 00 00 03 60 74 01 91 06 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
        General
        Stream Path:VBA/__SRP_e
        File Type:data
        Stream Size:314
        Entropy:2.0336709495517145
        Base64 Encoded:False
        Data ASCII:r U . . . . . . . . @ . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . ~ x . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . a . . . . . . . . . . . . . . . . . . . . . S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . S . . "
        Data Raw:72 55 00 03 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 04 00 00 00 00 00 00 7e 78 00 00 00 00 00 00 7f 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 0f 00 10 00 00 00 00 00 00 00 00 00 0e 00 00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
        General
        Stream Path:VBA/__SRP_f
        File Type:data
        Stream Size:328
        Entropy:1.9053797189114703
        Base64 Encoded:False
        Data ASCII:r U @ . . . . . . . . . . . . . . . @ . . . . . . . @ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . ` . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . . . 8 . a . . . . . . . . . . . . . . ` . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . ` . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . ` . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . b . . . . . . .
        Data Raw:72 55 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1a 00 00 00 00 00 00 00 11 00 00 00 00 00 00 00 00 00 0e 00 ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00 10 00 00 00 08 00 38 00 f1 00 00 00 00 00 00 00 00 00 0e 00 00 00 00 60 00 00 fd ff ff ff e1 11 00 00 00 00 00 00 00 00 01 00 31 12 00 00 00 00 00 00
        General
        Stream Path:VBA/dir
        File Type:data
        Stream Size:1155
        Entropy:6.637241864567654
        Base64 Encoded:True
        Data ASCII:. . . . . . . . . . 0 * . . . . p . . H . . . . d . . . . . . . V B A P r o j e c t . . 4 . . @ . . j . . . = . . . . r . . . . . . . . . y [ . . . . J < . . . . . r s t d o l e > . . . s . t . d . o . l . e . . . h . % . ^ . . * \\ G { 0 0 0 2 0 4 3 0 - . . . . . C . . . . . . 0 0 4 . 6 } # 2 . 0 # 0 . # C : \\ W i n d . o w s \\ S y s t e m 3 2 \\ . e 2 . . t l b # O L E . A u t o m a t i . o n . ` . . E O f f D i c E O . f . i . c E . . E . 2 D F 8 D 0 4 C . - 5 B F A - 1 0 1 B - B D E 5 E A A C 4 . 2 E
        Data Raw:01 7f b4 80 01 00 04 00 00 00 03 00 30 2a 02 02 90 09 00 70 14 06 48 03 00 82 02 00 64 e2 04 04 00 0a 00 1c 00 56 42 41 50 72 6f 6a 65 88 63 74 05 00 34 00 00 40 02 14 6a 06 02 0a 3d 02 0a 07 02 72 01 14 08 05 06 12 09 02 12 b4 79 96 5b 0b 94 00 0c 02 4a 3c 02 0a 16 00 01 72 80 73 74 64 6f 6c 65 3e 02 19 00 73 00 74 00 64 00 6f 00 80 6c 00 65 00 0d 00 68 00 25 02 5e 00 03 2a 5c 47
        No network behavior found
        050100s020406080100

        Click to jump to process

        050100s0.001020MB

        Click to jump to process

        Target ID:0
        Start time:18:15:16
        Start date:24/11/2022
        Path:C:\Program Files\Microsoft Office\Office14\EXCEL.EXE
        Wow64 process (32bit):false
        Commandline:"C:\Program Files\Microsoft Office\Office14\EXCEL.EXE" /automation -Embedding
        Imagebase:0x13ffc0000
        File size:28253536 bytes
        MD5 hash:D53B85E21886D2AF9815C377537BCAC3
        Has elevated privileges:true
        Has administrator privileges:true
        Programmed in:C, C++ or other language
        Reputation:high
        There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
        There is hidden Windows Behavior. Click on Show Windows Behavior to show it.
        There is hidden Windows Behavior. Click on Show Windows Behavior to show it.

        No disassembly