Sub ClipboardSry()
'参照定義で以下を有効にしておく
'C:\Windows\System32\FM20.DLL
'C:\Windows\SysWOW64\FM20.DLL
buf = "ABB"
With New MSForms.DataObject
.SetText buf '変数の値をDataObjectに格納する
.PutInClipboard 'DataObjectのデータをクリップボードに格納する
End With
End Sub
Sub HTTPリクエスト()
'宣言
'Microsoft HTML Object Library
'Microsoft Internet Controls
'Microsoft XML. V6.0
Dim httpReq As XMLHTTP60
Set httpReq = New XMLHTTP60
httpReq.Open "GET", "https://news.yahoo.co.jp/rss/topics/top-picks.xml"
httpReq.send
Do While httpReq.readyState < 4
DoEvents
Loop
Dim htmlDoc As Object
Set htmlDoc = New HTMLDocument
htmlDoc.Write httpReq.responseText
Range("A1").Value = htmlDoc.Title
Range("A2").Value = httpReq.responseText
'Range("A3").Value = htmlDoc.getElementsByTagName("p")(0).innerText
Set htmlDoc = Nothing
Set httpReq = Nothing
End Sub
Sub Sample1()
Dim ObjBrw As Object
Set ObjBrw = CreateObject("InternetExplorer.Application")
With ObjBrw
.Navigate "https://www.google.co.jp/"
.Visible = False
Do While .Busy = True Or .ReadyState <> 4
Loop
End With
ObjBrw.Quit
End Sub
Range("1:5").EntireRow.AutoFit()
ActiveSheet.Shapes.AddTextEffect(msoTextEffect31, "テキスト", "+mn-lt", 60, msoFalse, msoFalse, 1, 1).Select
With Selection.ShapeRange(1).TextFrame2.TextRange.Characters(1, 1).Font.Fill
.Visible = msoTrue
.ForeColor.RGB = RGB(255, 0, 0)
.Transparency = 0
.Solid
End With
With ActiveSheet.Shapes(1)
.Left = Range("N46").Left
.Top = Range("N46").Top
End With
Selection.ShapeRange.IncrementLeft -3
Selection.ShapeRange.IncrementTop -24