Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Found a solution: MSPaint = Shell("mspaint.exe", 1) 'Delay until MS Paint is open Do Until Wait < 0 DoEvents Wait = FindWindow("MSPaintApp", "untitled - Paint") Loop Set PriceList = Workbooks.Open(ThisWorkbook.Path & "\..\Quote Template\HC Price Lists.xlsm", ignorereadonlyrecommended:=True) Set QuoteSht = ThisWorkbook.Sheets("Quote") QuoteSht.Activate QuoteSht.Unprotect Password:=Workbooks("HC Price Lists.xlsm").Worksheets("Belgotex").Range("W1") ' Copy range to MS Paint and protect QuoteSht Range("A1:W67").CopyPicture Appearance:=xlScreen, Format:=xlPicture ActiveSheet.Protect Password:=Workbooks("HC Price Lists.xlsm").Worksheets("Belgotex").Range("W1") AppActivate MSPaint SendKeys "^v", True DoEvents ' Set Save As Parms FileName = ThisWorkbook.Name Application.Wait Now + TimeValue("00:00:01") SendKeys ALT & "F", True ' File Menu DoEvents Application.Wait Now + TimeValue("00:00:01") SendKeys "A", True ' Save As dialog DoEvents Application.Wait Now + TimeValue("00:00:01") SendKeys Left(FileName, Len(FileName) - 1), True DoEvents SendKeys "{BACKSPACE 4}", True DoEvents SendKeys ".jpg", True ' Set image format DoEvents Application.Wait Now + TimeValue("00:00:02") SendKeys "{TAB}", True ' Select 'save as type' drop down menu DoEvents Application.Wait Now + TimeValue("00:00:01") SendKeys "{DOWN 2}", True ' Select .jpg file format DoEvents Application.Wait Now + TimeValue("00:00:01") SendKeys "{ENTER}", True ' Activate selection DoEvents Application.Wait Now + TimeValue("00:00:01") SendKeys ALT & "S", True ' Save DoEvents Application.Wait Now + TimeValue("00:00:03") 'Close MS Paint SendKeys ALT & "{F4}", True DoEvents Application.Wait Now + TimeValue("00:00:01") Application.Interactive = True Application.DisplayAlerts = True Application.WindowState = xlMaximized YIPPEEEEE!!!! :) -- ARbitOUR ------------------------------------------------------------------------ ARbitOUR's Profile: http://www.thecodecage.com/forumz/member.php?userid=254 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=97712 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy & paste range | Excel Discussion (Misc queries) | |||
How do I copy a picture from Paint to a specific cell in Excel? | Excel Discussion (Misc queries) | |||
copy range and paste into every 3rd cell of new range | New Users to Excel | |||
Copy paste range | Excel Programming |