Hello all,
I have the following code that i found on the net.
This successfully launches the snipping tool. What I'm try to accomplish is..
- Once the area from the snipping tool is selected add it to a sheet in the workbook
- a message box that asks how big the The snippet should be and Resize it
-place it on that sheet in B3....
Bonus...
if its launched again..
Do all the above, but place it next to the previous picture...
(5 across)...
once 5 across has been reached...move down below the first picture and repeat...etc etc..
Your thoughts or comments?
if you have a better way i am certainly open to ideas...Im not an Excel star like you guys..but i could really use the help.
I just need to be able to Capture a Web page...Crop it, resize it, and place it 5 Across the downards if possible.
I have the following code that i found on the net.
Code:
'Used to wait for 200 milliseconds in the Sub.
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Function IsExeRunning(sExeName As String, Optional sComputer As String = ".") As Boolean
On Error GoTo Error_Handler
Dim objProcesses As Object
Set objProcesses = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & sComputer & "\root\cimv2").ExecQuery("SELECT * FROM Win32_Process WHERE Name = '" & sExeName & "'")
If objProcesses.Count <> 0 Then IsExeRunning = True
Error_Handler_Exit:
On Error Resume Next
Set objProcesses = Nothing
Exit Function
Error_Handler:
MsgBox "The following error has occured." & vbCrLf & vbCrLf & _
"Error Number: IsExeRunning" & vbCrLf & _
"Error Description: " & Err.Description, _
vbCritical, "An Error has Occured!"
Resume Error_Handler_Exit
End Function
Sub SnipTool()
Dim wsh As Object
Set wsh = VBA.CreateObject("WScript.Shell")
wsh.Run "C:\Windows\sysnative\SnippingTool.exe"
X = 0
Select Case Mid(Application.OperatingSystem, 21)
Case 6.02
Do Until IsExeRunning("SnippingTool.exe") = True Or X = 200
'added Timeout if snipping tool fails to load. Prevents Excel freezing.
X = X + 1
Loop
Sleep (200)
AppActivate "Snipping Tool", True
Application.SendKeys "^N", True
End Select
End Sub
This successfully launches the snipping tool. What I'm try to accomplish is..
- Once the area from the snipping tool is selected add it to a sheet in the workbook
- a message box that asks how big the The snippet should be and Resize it
-place it on that sheet in B3....
Bonus...
if its launched again..
Do all the above, but place it next to the previous picture...
(5 across)...
once 5 across has been reached...move down below the first picture and repeat...etc etc..
Your thoughts or comments?
if you have a better way i am certainly open to ideas...Im not an Excel star like you guys..but i could really use the help.
I just need to be able to Capture a Web page...Crop it, resize it, and place it 5 Across the downards if possible.
Last edited: