Z
Zakynthos
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!
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!