How to make an array with ActiveX Excel using Excel_RangeSetValue2?

Hello,
I want to make an array on Excel. For that, I'm using two functions : Excel_WorksheetGetRange and Excel_RangeSetValue2.
I write the array on Excel file but only the first case of the array is copied.
Here, a part of my program :
char * DataToWrite = {"A", "B", "C", "D"}
char cCell[10];
VARIANT             vCell, Data;
ExcelObj_Worksheet hWorksheet;
ExcelObj_Range      hRange;
  CA_VariantSetCString (&vCell,cCell);        //cCell = A1:A4
  Excel_WorksheetGetRange (hWorksheet, NULL, vCell, CA_DEFAULT_VAL, &hRange);
  CA_VariantSetCString (&Data,DataToWrite );
  Excel_RangeSetValue2 (hRange, NULL, Data);
Here what I obtain when I'm compiling on Excel file :
A
A
A
A
Solved!
Go to Solution.

You should use other instructions to fill the range of cells:
strcpy (msg, "A1:A4");
CA_VariantSetCString (&MyVariant, msg);
Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyVariant, CA_DEFAULT_VAL, &ExcelRangeHandle);
Excel_RangeActivate (ExcelRangeHandle, NULL, NULL);
// Create a SafeArray from array of data
CA_VariantSet2DArray (&MyVariant, CAVT_CSTRING, righe, 1, array);
// Transfer data to Excel range
Excel_SetProperty (ExcelRangeHandle, NULL, Excel_RangeValue2, CAVT_VARIANT, MyVariant);
ClearObjHandle (ExcelRangeHandle);
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Here's how to make an iDVD with no flicker using Ken Burns Effect

    iPhoto renders the Ken Burns effect as smoothy as can be - no flicker
    iMovie does a poor job of rendering the Ken Burns Effect - much flicker
    so
    1. Make a slide show in iPhoto. Single out only those slides that have the Ken Burns Effect. Each of these slides is turned into a Slide Show of just one slide at a time.
    2. Each single slide with the Ken Burns effect is adjusted for time, etc. and then exported into a QuickTime Movie - a movie consisting of only one slide.
    3. Save all the individual movies into one folder (for convenience).
    4. In iMovie (I use 06) , assemble the slide show - but only include all the slides that have no Ken Burns Effect.
    5. Drag each of the single-slide movies into the iMovie clip pane, and then place them where you want between the other slides.
    6. Play the iMovie and see how smoothly ALL the slides play.
    7. Send the entire iMovie over to iDVD and burn it. Make sure the "Interlace" feature (File Menu -Interlace) is NOT checked.
    8. All the Ken Burns slides will be rendered with hardly any flicker.

    Like most iLife 08 owners I use iMovie 06.
    Do you believe that your procedure will work the same way using iMovie 06 with iDVD 08?

  • How to encrypt byte array with out padding using RSA in Java?

    I've modulus and public exponent as byte[] array, so I'm trying to convert into BigIntegers and then create public key and then Cipher. Here is the example code:
    With this I'm always getting different encrypted bytes, is it because of padding. I dont want to use any padding so what parameter I need to pass along with RSA? I've modulus byte[] array size 64 bytes. I believe I'll get 64 encrypted bytes. I've content size of 32 bytes to be encrypted.
    --------code begin ---------------------------
    BigInteger bexponent = new BigInteger(pubExpo);
    BigInteger bmodulus = new BigInteger(modulus);
    KeyFactory keyFactory = KeyFactory.getInstance("RSA");
    RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(bmodulus, bexponent);
    RSAPublicKey pubKey = (RSAPublicKey)keyFactory.generatePublic(pubKeySpec);
    Cipher c = Cipher.getInstance("RSA");
    c.init(Cipher.ENCRYPT_MODE, pubKey);
    return c.doFinal(content);
    --------code end---------------------------

    With this I'm always getting different encrypted
    bytes, is it because of padding. Yes, if you're using PKCS1Padding (which is the default in SunJCE if you don't specify it). Have a look at the PKCS1 spec if you haven't seen it already.
    http://www.rsasecurity.com/rsalabs/pkcs
    Section 7.2.1 talks about type 2 padding, which uses random bytes as the PS string.
    I dont want to use
    any padding so what parameter I need to pass along
    with RSA? NOPADDING. You should be able to find this out by look at the "Supported Paddings" parameter in your provider's database. Which of course, means you'll need to supply the right number of bytes to the Cipher.

  • How to make text columns with adobe muse

    Hi,How to make text columns with adobe muse (like InDesign)?

    Multiple columns can be acheived with CSS - http://www.w3schools.com/css/css3_multiple_columns.asp
    div
    -moz-column-count:3; /* Firefox */
    -webkit-column-count:3; /* Safari and Chrome */
    column-count:3;
    I'm surprised that Muse does not support text columns yet, but perhaps the custom CSS can be added in style tags on page properties. Haven't tried it, but don't see why it wouldn't work.

  • How to build a array with high sampling rates 1K

    Hi All:
    Now I am trying to develop a project with CRio.
    But I am not sure how to build a array with high sampling rates signal, like >1K. (Sigle-point data)
    Before, I would like to use "Build Arrary" and "Shift Register" to build a arrary, but I found it is not working for high sampling rates.
    Is there anyother good way to build a data arrary for high sampling rates??
    Thanks
    Attachments:
    Building_Array_high_rates.JPG ‏120 KB

    Can't give a sample of the FPGA right now but here is a sample bit of RT code I recently used. I am acquiring data at 51,200 samples every second. I put the data in a FIFO on the FPGA side, then I read from that FIFO on the RT side and insert the data into a pre-initialized array using "Replace Array subset" NOT "Insert into array". I keep a count of the data I have read/inserted, and once I am at 51,200 samples, I know I have 1 full second of data. At this point, I add it to a queue which sends it to another loop to be processed. Also, I don't use the new index terminal in my subVI because I know I am always adding 6400 elements so I can just multiply my counter by 6400, but if you use the method described further down below , you will want to use the "new index" to return a value because you may not always read the same number of elements using that method.
    The reason I use a timeout of 0 and a wait until next ms multiple is because if you use a timeout wired to the FIFO read node, it spins a loop in the background that polls for data, which rails your processor. Depending on what type of acquisition you are doing, you can also use the method of reading 0 elements, then using the "elements remaining" variable, to wire up another node as is shown below. This was not an option for me because of my programs architecture and needing chunks of 1 second data. Had I used this method it would have overcomplicated things if I read more elements then I had available in my 51,200 buffer.
    Let me knwo if you have more qeustions
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    RT.PNG ‏36 KB
    FIFO read.PNG ‏4 KB

  • How to make turning page with ibooks author?

    How to make turning page with ibooks author?

    This question has been answered on this thread
    https://discussions.apple.com/message/17981772#17981772#17981772
    Best regards.
    Alex

  • How to populate an array with random text files.

    I am making a Jeopardy program. I have my program set up so that it retrieves 5 random text files. I just want to know how I populate one array with all the lines from the text files my program is retrieving.

    You can read a textfile line by line and add each line to an ArrayList. An ArrayList is very much like an array only that it's "open ended". You can start adding lines without first knowing how many you're going to get. If you still want an ordinary "static" array when you're finished reading lines you can easily get one from the ArrayList and then drop the ArrayList.

  • How to create 2D array with 3 rows and unlimit column?

    how to create 2D array with 3 rows and unlimit column?

    Here are images of what I described in my previous post
    Message Edited by JoeLabView on 11-14-2007 07:56 AM
    Attachments:
    2D-array_code.PNG ‏7 KB
    2D-array_values.PNG ‏13 KB

  • How to make this work with Firefox, HELP!

    Downloading for Real-player, after watching the full movie, I click download and it has to reread the movie from the internet. When using explorer, after downloading the movie, it reads it from memory, which makes it a fast download. How to make this work with Firefox, I like not to use Microsoft products, and I really like Firefox 7.0.1!!!! HELP!

    -> click '''Firefox''' button and click '''Options''' (OR File Menu -> Options)
    * Advanced panel -> Network tab
    * place Checkmark on '''Override Automatic Cache Management''' -> under '''Limit Cache''' specify a large size of space
    * Remove Checkmark from '''Tell me when websites asks to store data for offline use'''
    * click OK on Options window
    * Restart Firefox
    Check and tell if ts working.

  • How to make email link with a button with AC2 in flash cs3?

    How to make email link with a button with AC2 in flash cs3?
    I wrote this, but it does not work:
    btn_emailinfo.on (release) {
    getURL("mailto:"[email protected]");
    }

    I am guessing you put that on a frame?
    If so, the syntax is as follows:
    btn_emailinfo.onRelease = function(){
    getURL("mailto:[email protected]");
    Though, if you are placing it directly on the button itself,
    the syntax is:
    on(release){
    getURL("mailto:[email protected]");
    }

  • I reset my phone and it now receives calls that were meant for my husband. I know how to fix this with messaging and facetime, but can't seem to find how to make it stop with the calls. Please help.

    I reset my phone and it now receives calls that were meant for my husband. I know how to fix this with messaging and facetime, but can't seem to find how to make it stop with the calls. Please help.

    It may be due to Continuity
    The following quote is from  Connect your iPhone, iPad, and iPod touch using Continuity
    Turn off iPhone cellular calls
    To turn off iPhone Cellular Calls on a device, go to Settings > FaceTime and turn off iPhone Cellular Calls.

  • In JSF, how to make a menu with access control?

    In JSF, how to make a menu with access control?
    The access control can be guided by programming, database or other means if possible?
    Thanks

    I want to make a dvd menu in iMovie because i don't have IDVD and can't find anywhere to download it?
    For making DVDs I would recommend iMovie 06 and iDVD 09 both readily available on Amazon or eBay.  Shop for iLife 06 and iLife 09.
    You can make menus and chapters with any version of iMovie except the latest one. There's nothing wrong with iMovie 11 either but I prefer iMovie 06.
    By using iMovie 06 and iDVD 09 I make DVDs with professional moving menus with very little effort. They look almost as good as Hollywood.

  • How to make slide images with Dreamweaver CS6?

    How to make slide images with Dreamweaver CS6? Please teach me.

    Hello
    in addition to Jon's hint, I'll send you some links to nice sliders (have fun with the different representations ):
    http://sandbox.scriptiny.com/javascript-slideshow/
    http://jquery.malsup.com/cycle/
    http://wowslider.com/best-jquery-slider-crystal-linear-demo.html
    http://www.jcoverflip.com/demo
    http://www.jacksasylum.eu/ContentFlow/
    http://addyosmani.com/blog/jqueryuicoverflow/
    You only need to use the source code to implant these shows there where you want. In my eyes it would be the best that you use first a very new and blank DW file to perform (maybe in LiveView) the one or the other.
    Hans-Günter

  • How do i share music with 2 iphones using the same apple id?

    how do i share music with 2 iphones using the same apple id?

    Sync them both to the same iTunes music library.  You can also automatically download purchased music to both by going to Settings>iTunes & App Stores and turning Music to On under Automatic Downloads.  If you music is in multiple computers, you can enable Home sharing to share your music library across multiple devices (see http://support.apple.com/kb/HT3819).

  • How can I work lsmw with table control using mm01 appl?

    Hi
    How can I work lsmw with table control using mm01 appl?
    Is it difefrent the way we handle table control in BDC?
    Thank You

    Hi
    How can I work lsmw with table control using mm01 appl?
    Is it difefrent the way we handle table control in BDC?
    Thank You

Maybe you are looking for

  • FTP & Logical Filename

    Hi Experts, We have an FTP program, that will pick up the file on application server, will remane the file & send it to the specified destination. My query is, I need to created one more file & that needs to renamed to other name, how can I achieve t

  • Terrible shopping experience about my Ideapad Ultrabook U410

    I write to complain about the poor product and bad service of Lenovo. I purchased my laptop on the lenovo.com in September, 23th, 2012. The order # is [Moderator Note: Edited to protect privacy.]. I strongly dissatisfied with the product and service

  • Adobe reader xi installing error 1303

    Hi, if i try to install it, i get that message: Error 1303. The installer has insufficient privileges to access this directory on c:\program files, also  after some reboots or in  boot in safe mode, i'm able to install it, but it refuse to open any p

  • Help me please my bb curve 9360 is yet to work

    Hello evryone When I tried to log in to my facebook messenger, twitter or other social network on my blackberry 9360 it didn't work I receive a response that ''you are currently on a data plan that does not support this service please connect to a wi

  • Not able to access Safe Mode nor boot off of Tiger DVD

    I am running an iMac with Tiger 10.4.11. After doing an update of software I cannot boot. I have not been able to access Safe Mode or boot off a Tiger DVD. With DVD inserted I wait till I hear the bong noise then I press the letter C. It thinks for a