Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel 2003. Assign array to range

Hi everyone, and sorry for my english

I have an excel application, developed in Excel XP. In a line of code, I
have this statement:
MyRange.Value = myArray

myArray is a two dimensions array, which has the same number of rows and
columns than the range object I'm trying to assign.

This code runs without problems in XP, but when I try to run it under Excel
2003, I'm getting the error "Application or object defined error".

¿Any suggestion?

thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Excel 2003. Assign array to range

Sub AA()
Dim myRange As Range
Dim myarray(1 To 3, 1 To 10) As Long
For i = 1 To 3
For j = 1 To 10
myarray(i, j) = i * j
Next
Next
Set myRange = Range("M10").Resize(1, 10)
myRange.Value = myarray
End Sub

worked fine for me in xl2003.

--
Regards,
Tom Ogilvy


"Jorge Vinuales" wrote:

Hi everyone, and sorry for my english

I have an excel application, developed in Excel XP. In a line of code, I
have this statement:
MyRange.Value = myArray

myArray is a two dimensions array, which has the same number of rows and
columns than the range object I'm trying to assign.

This code runs without problems in XP, but when I try to run it under Excel
2003, I'm getting the error "Application or object defined error".

¿Any suggestion?

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Excel 2003. Assign array to range

Yes, thanks Tom.

I have realized that the problem must be with one of the formulas of the
array.
The values of the array are numbers and sometimes formulas. Some of them are
causing some kind of problem but if I try to write by hand those formulas in
the worksheet, there is no problem with them.

I suppose that my problem could be the language version (spanish)

I'll continue investigating...


"Tom Ogilvy" escribió en el mensaje
...
Sub AA()
Dim myRange As Range
Dim myarray(1 To 3, 1 To 10) As Long
For i = 1 To 3
For j = 1 To 10
myarray(i, j) = i * j
Next
Next
Set myRange = Range("M10").Resize(1, 10)
myRange.Value = myarray
End Sub

worked fine for me in xl2003.

--
Regards,
Tom Ogilvy


"Jorge Vinuales" wrote:

Hi everyone, and sorry for my english

I have an excel application, developed in Excel XP. In a line of code, I
have this statement:
MyRange.Value = myArray

myArray is a two dimensions array, which has the same number of rows and
columns than the range object I'm trying to assign.

This code runs without problems in XP, but when I try to run it under
Excel
2003, I'm getting the error "Application or object defined error".

¿Any suggestion?

thanks





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
Excel 2003 Add-ins - Assign Number JanieB Excel Worksheet Functions 3 September 19th 07 09:07 PM
How do I assign sequential numbers in an Excel 2003 PO template? skiusa Excel Worksheet Functions 1 March 28th 05 10:57 PM
Can't assign to Array .GetRows in Excel 97 Lenn Excel Programming 2 June 24th 04 02:30 AM
Can't assign to Array .GetRows in Excel 97 Lenn Excel Programming 0 June 24th 04 12:58 AM
Assign macro to button in EXCEL 2003 Steffen Kuenstner Excel Programming 1 January 8th 04 11:04 AM


All times are GMT +1. The time now is 05:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"