Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2003, 04:40 PM
Registered User
 
Join Date: Jun 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Application-defined or object-defined error

Hi,

My VBA application is writing to a Office XP Excel sheet. However, if I click on the cells during the writing process there is an error thrown at the point of the .Cells().value:

'Row is some row number
  With Worksheets("Sheet_I_am_writing_too")
          .Cells(Row, 1).value = 'some value
  End With

This error is Application-defined or object-defined error. It appears that excel loses its cell position. Once the function is recalled Excel is able to continue without an error.

Does anyone know what causes this.

Thanks in advance.
 
Old August 12th, 2003, 11:50 PM
Registered User
 
Join Date: Aug 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

try this

Dim shtSheetToWork as worksheer
set shtSheetToWork =ActiveWorkbook.Sheets("Sheet_I_am_writing_too")
shtSheetToWork.Cells(Row, 1).value = 'some value
set shtSheetToWork =nothing






Similar Threads
Thread Thread Starter Forum Replies Last Post
Appl-defined or Object-defined error 1004 chp Excel VBA 3 April 4th, 2006 08:12 AM
User-defined type not defined (Icecream.mdb) dloren01 BOOK: Beginning Access VBA 0 June 22nd, 2005 10:36 PM
Application Defined Error in Excel VBA mahanti BOOK: Professional Crystal Reports for VS.NET 0 May 27th, 2005 12:38 AM
object defined error piyushdabomb Excel VBA 1 February 1st, 2005 01:26 AM
Application-defined error Ned Pro VB 6 0 December 11th, 2003 01:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.