|
|
Automation - any size limitations of VARIANT
I want to use Automation to send a fairly large XML string to an Excel
Macro using
VARIANT _Application::Run(const VARIANT& Macro, const VARIANT& Arg1,
const VARIANT& Arg2,....const VARIANT& Arg30);
I would like to send up to 2 to 3mb as an XML string - does anyone know
if this will be OK - before I spend too much time trying to implement it
Many thanks for any replies
|
|
0
|
|
|
|
Reply
|
phil
|
2/28/2010 3:08:39 PM |
|
"phil oakleaf" <news@oakleafsoftware.co.uk> ha scritto nel messaggio
news:#oAk7fIuKHA.5384@TK2MSFTNGP04.phx.gbl...
> I want to use Automation to send a fairly large XML string to an Excel
> Macro using
>
> VARIANT _Application::Run(const VARIANT& Macro, const VARIANT& Arg1,
> const VARIANT& Arg2,....const VARIANT& Arg30);
>
> I would like to send up to 2 to 3mb as an XML string - does anyone know if
> this will be OK - before I spend too much time trying to implement it
I think that OLE Automation uses BSTR type to pass strings.
Those BSTR types are Unicode (wchar_t) length-prexifed strings.
It seems that the length field is four bytes:
http://msdn.microsoft.com/en-us/library/ms221069.aspx
Moreover, the SysAllocStringLen API
http://msdn.microsoft.com/en-us/library/ms221639.aspx
has a parameter 'cch' which is an 'unsigned int', so its max value should be
2^32-1 in 32-bit systems.
So 2-3 MB for a BSTR should be just fine.
Giovanni
|
|
0
|
|
|
|
Reply
|
Giovanni
|
2/28/2010 3:56:12 PM
|
|
Giovanni Dicanio wrote:
> "phil oakleaf" <news@oakleafsoftware.co.uk> ha scritto nel messaggio
> news:#oAk7fIuKHA.5384@TK2MSFTNGP04.phx.gbl...
>
>> I want to use Automation to send a fairly large XML string to an Excel
>> Macro using
>>
>> VARIANT _Application::Run(const VARIANT& Macro, const VARIANT& Arg1,
>> const VARIANT& Arg2,....const VARIANT& Arg30);
>>
>> I would like to send up to 2 to 3mb as an XML string - does anyone
>> know if this will be OK - before I spend too much time trying to
>> implement it
>
> I think that OLE Automation uses BSTR type to pass strings.
> Those BSTR types are Unicode (wchar_t) length-prexifed strings.
>
> It seems that the length field is four bytes:
>
> http://msdn.microsoft.com/en-us/library/ms221069.aspx
>
> Moreover, the SysAllocStringLen API
>
> http://msdn.microsoft.com/en-us/library/ms221639.aspx
>
> has a parameter 'cch' which is an 'unsigned int', so its max value
> should be 2^32-1 in 32-bit systems.
> So 2-3 MB for a BSTR should be just fine.
>
> Giovanni
>
>
>
Thanks for the info - I'll try it out with something much bigger and see
what happens
Phil
|
|
0
|
|
|
|
Reply
|
phil
|
2/28/2010 5:40:31 PM
|
|
Just tested it with an 8mb string and it worked fine
I should have tried this rather than being lazy and asking for help
Phil
|
|
0
|
|
|
|
Reply
|
phil
|
3/1/2010 8:30:27 AM
|
|
"phil oakleaf" <news@oakleafsoftware.co.uk> wrote in message
news:eB47zlRuKHA.6124@TK2MSFTNGP04.phx.gbl...
>
> Just tested it with an 8mb string and it worked fine
>
> I should have tried this rather than being lazy and asking for help
Look at it this way, now there is a record that will show up in a google
search for anyone else with the same question! You weren't lazy, you
performed a valuable service! ;-)
-Pete
|
|
0
|
|
|
|
Reply
|
Pete
|
3/1/2010 7:14:36 PM
|
|
|
4 Replies
313 Views
(page loaded in 0.05 seconds)
Similiar Articles: Expression doesn't contain Automation Object - microsoft ...Expression doesn't contain Automation Object - microsoft ... Expression doesn't contain Automation Object - microsoft ... Object or class does not support the set of ... Limit text box to any character except \, /, :, ?, <, > ...... you are looking for: Function Valid_Field_Name(NameText As Variant) As ... Is there any way to increase the font size used ... Limit text box to any character except ... microsoft.public.windows.powershellFile size limit when using Move-item cmdlet? Utf 1 427 Greetings all, Quick question. Is there a file size limitation when using the Move-item cmdlet? Problem automating page in IE 8 - microsoft.public.vb.general ...... DocumentComplete(ByVal pDisp As Object, URL As Variant ... com/Uwe/Forum.aspx/basic/7680/Internet-Explorer-Automation ... I had a routine to find the available size of the ... Can't receive UDP packets with winsock2 - microsoft.public ...... if (recv(fd, pszRecvData, READ_PACKET_SIZE, 0 ... tried all the possible functions with the WSA variant as ... that the IP address range had some very bizarre limitations. MS Office keeps crashing - microsoft.public.access.forms ...Most > significant is the fact that it does not expose itself to Automation like ... Excel file size limitation - microsoft.public.excel.misc ... I've got someone trying to ... Access crashes when importing dbf file - microsoft.public.access ...Any dbf file or just a particular file? If it's a ... Limit - microsoft.public.access Import File Size Limitations ... as dbf files or txt files, with some minor variation. Problem calling unmanaged DLL from VB.NET - microsoft.public ...... brick wall for 4 days, and I've reached the limit of ... Class doesn't support Automation Problem - microsoft.public ... Variant) Dim obj Dim i As ... Problem calling unmanaged ... Initiating and Executing Excel Code from Access - microsoft.public ...Can anybody shed any light on whether this can be done ... Does anybody have sample VBA code to open ... with Variants ... And Excel 2003 has a limit of 65535 rows and ... how can i duplicate characters - microsoft.public.scripting ...All variables are of type Variant. VB for applications ... Limitation to Copy/Paste - microsoft.public.word ... Drag this slider to change size of the characters. ☹ ☺ XL: Limitations of Passing Arrays to Excel Using Automation... Microsoft Excel worksheets and macros using Automation. If these limitations ... Public Sub AcceptArray(ByVal myarray As Variant) MsgBox "Size of first ... Automation arrays - Gekko Software homeThe elements of a variant array can be almost any type, as I am covering automation I will limit the ... A variant is physical a record, 14 bytes in size. The data of ... Variant type - Wikipedia, the free encyclopediaIn unrelated usage, variant type is also used to refer to ... Size Description 0: 2: The value returned by VarType ... In OLE Automation the IDispatch interface is used when the ... Automation - Wikipedia, the free encyclopedia2.1 Limitations to automation; 2.2 Current limitations ... tasks that are beyond human capabilities of size ... Variants Modbus TCP/IP Overview - Industrial and Building Automation ...MODBUS TCP/IP is a variant of the MODBUS family of ... protocol is being published as a ('de-facto') automation ... multiple consecutive data items up to a data size limit ... 7/25/2012 10:14:57 PM
|
|
|
|
|
|
|
|
|