LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Creating a rectangle on an Excel sheet from VB

I am trying to create a rectangle on an Excel sheet witht the
following code. It fails with: "the specified value is out of range"
I am running VB6 and Excel 2000 on a Windows XP pro PC.

Thanks, Yagil
===
Dim MyXl As Excel.Application

Sub main()
Dim uiSheet1 As Worksheet
Dim uiRectangle1 As Shape

Set MyXl = CreateObject("excel.application")
MyXl.Workbooks.Add
Set uiSheet1 = Sheets.Add


Set uiRectangle1 = uiSheet1.Shapes.AddShape(msoShapeRectangle, _
10, 10, 100, 100) 'error: the specified value is out of range

End Sub


 
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
Excel 97 keeps changing dimensions of autoshape rectangle Roman Excel Discussion (Misc queries) 0 March 17th 10 04:38 PM
Excel - xy plot fill plotted rectangle Mark Charts and Charting in Excel 4 September 15th 09 04:54 PM
How do i delete a saved rectangle in excel? gltrg1991 Excel Worksheet Functions 3 February 17th 09 01:50 PM
How can cells be changed from rectangle to triangle in Excel? MD Excel Discussion (Misc queries) 1 February 21st 08 02:32 AM
Copy Rectangle Object From One Sheet To Another GeorgeF Excel Discussion (Misc queries) 0 May 24th 05 07:08 PM


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