Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 9
Default (SOLVED) Runtime error 438

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Runtime error 438

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   Report Post  
Junior Member
 
Posts: 9
Default

Thx....nice to know
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
runtime error '1004' application or object defined error Janis Excel Programming 4 November 18th 09 03:01 PM
runtime error 13 - type mismatch error in Excel 97 on Citrix Kevin Maher Excel Programming 7 March 8th 08 11:48 AM
runtime error '1004' application or object defined error. Please help deej Excel Programming 0 August 1st 07 09:26 AM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM


All times are GMT +1. The time now is 10:59 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"