Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete method of Range class failed


Hi guys

I have a program written in VB.Net that manipulate an XLS file usin
VBA. I have to delete some lines:

ows.Range("119.190").Delete("Shift:=" & -4162)

-4162 is the real value of xlUp

It raise me this exeption:

Delete method of Range class failed

Previously, I tried this:

ows.Select("119.190")
oEx.selection").Delete("Shift:=" & -4162)

The problem persist.

Any idea?

Thank you in advance

--
dan_code
-----------------------------------------------------------------------
dan_coder's Profile: http://www.excelforum.com/member.php...fo&userid=3668
View this thread: http://www.excelforum.com/showthread.php?threadid=56418

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Delete method of Range class failed

If you are using early binding, you can use xlShiftUp.
But shouldn't the Range be written as Range("119:190").
Also, Shift:= is a named argument and as such should not be in quotes, as
you are really passing on the number -4162, not the string <"Shift:="
& -4162.
A further point, the brackets after "Delete" should not be there as you are
not using the return value.

Unless these points above are not valid in the .Net environment.

NickHK

"dan_coder" wrote
in message ...

Hi guys

I have a program written in VB.Net that manipulate an XLS file using
VBA. I have to delete some lines:

ows.Range("119.190").Delete("Shift:=" & -4162)

-4162 is the real value of xlUp

It raise me this exeption:

Delete method of Range class failed

Previously, I tried this:

ows.Select("119.190")
oEx.selection").Delete("Shift:=" & -4162)

The problem persist.

Any idea?

Thank you in advance!


--
dan_coder
------------------------------------------------------------------------
dan_coder's Profile:

http://www.excelforum.com/member.php...o&userid=36685
View this thread: http://www.excelforum.com/showthread...hreadid=564187



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
Select method of range class failed sa02000[_5_] Excel Programming 5 October 5th 05 09:10 AM
"delete method of range class failed Kathy Goldie Excel Programming 2 May 19th 05 06:45 PM
Delete method of Range class failed - HELP!!! richilli Excel Programming 1 October 20th 04 06:24 PM
runtime error '1004' delete Method of Range Class Failed Tom Kennedy Excel Programming 0 April 14th 04 08:08 PM
runtime error '1004' delete Method of Range Class Failed Tom Ogilvy Excel Programming 0 April 1st 04 04:09 AM


All times are GMT +1. The time now is 10:28 AM.

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"