LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy range and paste into MS Paint


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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy & paste range nc Excel Discussion (Misc queries) 0 July 16th 09 06:58 PM
How do I copy a picture from Paint to a specific cell in Excel? tgw4 Excel Discussion (Misc queries) 1 March 22nd 08 02:52 AM
copy range and paste into every 3rd cell of new range thomsonpa New Users to Excel 4 December 3rd 07 01:47 PM
Copy paste range Marc Bell Excel Programming 2 February 16th 04 01:21 PM


All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"