Skip to content

Instantly share code, notes, and snippets.

View vba_read_text.vba
Sub read_text()
Dim buf As String
Dim n As Integer 'file number
Dim file As String
file = "C:\tmp\test.txt"
n = FreeFile
Open file For Input As #n
@eggist77
eggist77 / vba_make_arrow.vb
Last active Jul 18, 2021
vba: Insert an arrow in the selection hatena: entry/20181121/1542802915
View vba_make_arrow.vb
' @description Insert an arrow in the selection hatena: entry/20181121/1542802915
' @auther n.
' @version 1.0
' @since 2018.11.21
' @update 2018.11.21
Sub makeArrow()
Dim r As Range
Set r = Selection
@eggist77
eggist77 / __vbs_get_ini_lib.md
Last active Aug 11, 2021
vbs: get_ini_lib.vbs
View __vbs_get_ini_lib.md

code: VBScript
description: VBScriptでINIファイルの読み書きをできるようにする

@eggist77
eggist77 / get_program_list.ps1
Last active May 28, 2022
powershell Get a list of installed applications
View get_program_list.ps1
$CurrentDir = Split-Path $MyInvocation.MyCommand.Path
# 1
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
Export-csv -path $CurrentDir"\ProgramList1.csv" -Encoding Default -NoTypeInformation
# 2
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
@eggist77
eggist77 / getFilePathDlgIE.vbs
Last active Aug 10, 2021
vbs 1593831099_getFilePathDlgIE
View getFilePathDlgIE.vbs
Function getFilePathDlgIE()
Dim ie
Set ie = WScript.CreateObject("InternetExplorer.Application")
ie.Navigate "about:blank"
Do While ie.Busy = True And ie.ReadyState <> 4 'READYSTATE_COMPLETE = 4
WScript.Sleep 100
Loop
ie.document.write "<html><body><input type='file' id='selectFileDialog'></body></html>"
ie.document.getElementById("selectFileDialog").click
@eggist77
eggist77 / getFilePathDlgExcel.vbs
Last active Aug 10, 2021
vbs 1593831099_getFilePathDlgExcel
View getFilePathDlgExcel.vbs
Function getFilePathDlgExcel()
Dim excel
Set excel = CreateObject("Excel.Application")
buf = excel.GetOpenFilename("Text File,*.txt,All,*.*",1,"ファイルを選択して下さい","開く",false)
If buf <> False Then
getFilePathDlgExcel = buf
Else
WScript.Quit
End If
@eggist77
eggist77 / getFileList.vbs
Last active Aug 10, 2021
vbs getFileList.vbs
View getFileList.vbs
Set fso = CreateObject("Scripting.FileSystemObject")
folderPath = "."
getFileList fso.getFolder(folderPath)
sub getFileList(ByVal folder)
for each subFolder in folder.subfolders
WScript.Echo "d," & subFolder.name & "," & subFolder.size & "," & subFolder.ParentFolder
@eggist77
eggist77 / VBS_FileExists_FolderExists.vbs
Last active Aug 10, 2021
vbs VBS_FileExists_FolderExists.vbs
View VBS_FileExists_FolderExists.vbs
Dim filePath
Dim folderPath
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filePath) then
'あるよ
Else
'ないよ
View vbs_logger.vbs
class Logger
'------------------------------------------------------
'@ description : Logger
'@ auther : t.n
'@ version : 1.0
'@ since : 2020.4.4
'@ update : 2020.4.4
'------------------------------------------------------
private fso
@eggist77
eggist77 / vba_init_value.vb
Last active Jul 18, 2021
VBA initValue.vb
View vba_init_value.vb
Sub initValue()
Dim initBoolean As Boolean
Dim initByte As Byte
Dim initInteger As Integer
Dim initLong As Long
Dim initSingle As Single
Dim initDouble As Double
Dim initCurrency As Currency
Dim initDate As Date