Skip to content

Instantly share code, notes, and snippets.

@eggist77
eggist77 / getFilePathDlgIE.vbs
Created Jul 4, 2020
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
Created Jul 4, 2020
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
End Function
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
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 / initValue.vb
Created Mar 28, 2020
VBA initValue.vb
View initValue.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
View gist:3143a27721ce867416f65f404f7bf17f
Sub formatCondition()
Dim r As Range
Dim formatCondition As FormatCondition
'範囲設定
Set r = Range("A1:A5")
'条件付き書式の追加
Set formatCondition = r.FormatConditions.Add(Type:=xlTextString, String:="OK", TextOperator:=xlContains)
View nLib.vbs
'nLib Version = 1.11
Function dateFormat(ByVal format)
' format
' yyyymm
' yyyymmdd(default)
' yyyymmddhhmmss
' yyyymmdd_hhmmss
View accessVBA.vb
'保存ボタン
Private Sub saveBtn_Click()
DoCmd.RunCommand acCmdSaveRecord
End Sub
'キャンセルボタン
Private Sub canselBtn_Click()
Me.Undo
End Sub
View pathGet.vbs
Set fso = CreateObject("Scripting.FileSystemObject")
' Get ScriptFile folder
msgbox fso.getParentFolderName(WScript.ScriptFullName)
You can’t perform that action at this time.