Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pasting while in edit mode

I am trying to create a macro that will take a 3270 screen scrape and paste
it into an Excel cell. Using ^A/^C in 3270 app /F2/^V in Excel manually
works every time.

The following code does not work in VS2005:

' Enable the shortcut keys:
Xl.OnKey("^c")
Xl.OnKey("^v")
Xl.OnKey("^x")
Xl.CommandBars("Cell").Enabled = True
Xl.CutCopyMode = True

'Take Screen Shot
Dim ScreenShot As Object = Sess0.Screen.Area(1, 1, 24, 80, 1, 3)
Dim SS As String = ScreenShot.ToString
ScreenShot.select()
Sess0.Screen.copy()

Xl.Worksheets(1).Range("A24").select()
Xl.ActiveCell.Cells(3, 3).select()
Xl.SendKeys("{F2}")
Xl.SendKeys("{^V}")
Xl.SendKeys("{Enter}")



It will copy to the clipboard, but will not ^V to paste into the cell.

Error:
System.Runtime.InteropServices.COMException was unhandled
ErrorCode = -2146827284
Message = "Exception from HRESULT: 0x800A03EC"
Source = "Interop.Excel"


This seems like a straightforward copy/cut/paste macro that is turning into
a nightmare. Do I not have something else Enabled? Can I do it from the
clipboard?

Please help!
Reply
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
Invoke Edit Mode Zone[_3_] Excel Programming 6 September 15th 07 12:17 PM
Combo Box goes to edit mode even if design mode is in OFF position Chas Excel Discussion (Misc queries) 0 January 7th 05 07:21 PM
Edit mode Ken Travers Excel Programming 2 November 7th 04 09:57 PM
Edit Mode Nicke[_8_] Excel Programming 0 October 15th 04 12:49 PM
Edit Mode Nicke[_5_] Excel Programming 1 October 15th 04 11:59 AM


All times are GMT +1. The time now is 12:23 PM.

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

About Us

"It's about Microsoft Excel"