Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
HOW DO I DELETE A POST??? -------
Cant get it to work...please help!! Kim :) Have made a comment where the debugger makes the error box. Sub CopyOpenItems() Dim wbTarget As Workbook 'workbook where the data is to be pasted Dim wbThis As Workbook 'workbook from where the data is to copied Dim strName As String 'name of the source sheet/ target workbook saveFolder = "L:\INST\AFD 260 Automation\KM\Bane_dk_dataopsamling\Oversigtsskema er målinger\" 'set to the current active workbook (the source book) Set wbThis = ActiveWorkbook 'get the active sheetname of the book strName = ActiveSheet.Name 'open a workbook that has same name as the sheet name Set wbTarget = Workbooks.Open(saveFolder & "procent.xlsx") 'select cell A1 on the target book wbTarget.Range("C2").Select (---MAKING A RUNTIME ERROR 438---) 'clear existing values form target book wbTarget.Range("C2").ClearContents 'activate the source book wbThis.Activate 'clear any thing on clipboard to maximize available memory Application.CutCopyMode = False 'copy the range from source book wbThis.Range("G1").Copy 'paste the data on the target book wbTarget.Range("C2").PasteSpecial 'clear any thing on clipboard to maximize available memory Application.CutCopyMode = False 'save the target book wbTarget.Save 'close the workbook wbTarget.Close 'activate the source book again wbThis.Activate 'clear memory Set wbTarget = Nothing Set wbThis = Nothing End Sub Last edited by kima : December 11th 12 at 02:27 PM Reason: SOLVED |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
kima wrote:
HOW DO I DELETE A POST??? You can't. This is Usenet; Excelbanter is essentially just a Usenet<-WWW interface. Your post is archived *forever*. ;-) Enjoy. -- Microsoft gave you Windows -- OS/2 gave you the whole house. |
#3
![]() |
|||
|
|||
![]()
Thx....nice to know
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
runtime error '1004' application or object defined error | Excel Programming | |||
runtime error 13 - type mismatch error in Excel 97 on Citrix | Excel Programming | |||
runtime error '1004' application or object defined error. Please help | Excel Programming | |||
Excel 2003 Macro Error - Runtime error 1004 | Excel Discussion (Misc queries) | |||
Syntax Error Runtime Error '424' Object Required | Excel Programming |