View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Copy/paste from Excel to a password protected intranet application

You don't show any Get application line of code. Your code appears to be
pasting from one workbook to another workbook. I don't see any interaction
with another program.

--
Regards,
Tom Ogilvy

"Zakynthos" wrote in message
...
I would like to copy cells (one at a time) from Excel to a resource
management program that is password protected on my company intranet. It

is
not possible to paste columns in one go, so it must be done on a copy
cell/paste to cell repeat basis.

I've tried running the following code which I've seen from reading another
question but it errors at the Get application point.

Given the protection on the destination program, can this be done and if

so,
how?

The code I tried unsuccessfully was:

CombineFiles()
Range("A1").Select
MyBook = ActiveWorkbook.Name
MyTargetCell = ActiveCell.Address
MySource = Application.GetOpenFilename
Workbooks.Open Filename:=MySource
Range("A1").Select
Set myRange = Range(Selection,

ActiveCell.SpecialCells(xlCellTypeLastCell))
'<-Solution : Take out the select here because you are setting the myRange
with this line
myRange.Copy
Application.DisplayAlerts = False '<-- This will save you from having

Excel
notify you that you placed a large amount of info on the clipboard before
closing the source file
ActiveWorkbook.Close
Application.DisplayAlerts = True
Workbooks(MyBook).Activate
Range(MyTargetCell).Select
ActiveSheet.Paste
ActiveWorkbook.Save 'SaveAs MySource <-- this is saving the Activeworkbook
as the Source workbook (I don't think that is what you want to do?)


Many thanks for your help!