C++なら
m_coreWebView2->CallDevToolsProtocolMethod("Network.clearBrowserCache", "{}", handler);
.NETなら
_coreWebView2.CallDevToolsProtocolMethodAsync("Network.clearBrowserCache", "{}");
C++なら
m_coreWebView2->CallDevToolsProtocolMethod("Network.clearBrowserCache", "{}", handler);
.NETなら
_coreWebView2.CallDevToolsProtocolMethodAsync("Network.clearBrowserCache", "{}");
Function ParentDirName() As String With ThisWorkbook ParentDirName = Left(.Path, InStrRev(.Path, "\") - 1) End With End Function
select name from sqlite_master where type='table' order by name DESC LIMIT 1;
CFileFind find; CString filePath = _T("C:\sample.txt"); if (find.FindFile(filePath)) { // ファイルが存在する場合 } else { // ファイルが存在しない場合 }
select name from sqlite_master where type='table';
Public Function IsExistDirA(a_sFolder As String) As Boolean Dim result result = Dir(a_sFolder, vbDirectory) If result = "" Then '// フォルダが存在しない IsExistDirA = False Else '// フォルダが存在する IsExistDirA = True End If End Function
検索上位ででてくるWSH使うのは安定しないから使わないほうが良い
Private Declare Function MessageBoxTimeoutA Lib "user32" ( _ ByVal hWnd As Long, _ ByVal lpText As String, _ ByVal lpCaption As String, _ ByVal uType As Long, _ ByVal wLanguageId As Long, _ ByVal dwMilliseconds As Long) As Long ... Function TimeoutMsgBox(aStr As String, aTitle As String, aTimeouts As Long, aNType As Long) As Long Dim AnswerVal As Long AnswerVal = MessageBoxTimeoutA(0, aStr, aTitle, aNType, 0, aTimeouts * 1000) TimeoutMsgBox = AnswerVal End Function Sub テスト() If TimeoutMsgBox("5秒以内にキャンセルしないと自動でブックを閉じます", "確認", 5, vbOKCancel) <> vbCancel Then 'ブック閉じる ActiveWorkbook.Close SaveChanges:=True End If End Sub
別ブックをつくってコピーしてCSV出力、保存せず閉じるという技。
Option Explicit Sub sample() '出力するCSVファイル Const CSV_FILE As String = "C:\Users\user\Desktop\sample.csv" Dim targetRange As Range Dim wb As Workbook Dim fso As Object 'CSVファイルへ出力する範囲を指定 ※例としてシート「sample」のセル「B2」から続く一連の範囲を指定 Set targetRange = Worksheets("sample").Range("B2").CurrentRegion '新規ブックを作成 Set wb = Workbooks.Add 'CSVファイルへ出力する範囲を新規ブックへコピー targetRange.Copy wb.Worksheets(1).Range("A1") Set fso = CreateObject("Scripting.FileSystemObject") '出力するCSVファイルが既に存在する場合は削除 If fso.FileExists(CSV_FILE) Then fso.deleteFile CSV_FILE End If '新規ブックをCSVファイルとして出力 wb.SaveAs Filename:=CSV_FILE, FileFormat:=xlCSV '新規ブックを保存せずに閉じる wb.Close SaveChanges:=False '後片付け Set fso = Nothing End Sub
Dim ws As Worksheet Set ws = ActiveSheet ' CSV のデータを取り込むシート Dim qt As QueryTable Set qt = ws.QueryTables.Add(Connection:="TEXT;D:\hogehoge.csv", Destination:=ws.Range("A2")) ' CSV を開く With qt .AdjustColumnWidth = False 'セル幅自動調整を指定 .TextFilePlatform = 932 ' 文字コードを指定 .TextFileParseType = xlDelimited ' 区切り文字の形式 .TextFileCommaDelimiter = True ' カンマ区切り .RefreshStyle = xlOverwriteCells ' セルに上書き .Refresh ' データを表示 .Delete ' CSV との接続を解除 End With