LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to write 2D array to specific colums/rows in excel

Solved!
Go to solution

Also, since you decided to make the application not visible, you will have to save the workbook after writing the values to the range but before closing the application reference .  If you don't, the workbook will be open in memory but not accessible.  It's also good practice to close all references when you are through with them (i.e. worksheet, range, workbook, application, etc).

aputman
0 Kudos
Message 11 of 18
(2,270 Views)

@aputman wrote:

Also, since you decided to make the application not visible, you will have to save the workbook after writing the values to the range but before closing the application reference .  If you don't, the workbook will be open in memory but not accessible.  It's also good practice to close all references when you are through with them (i.e. worksheet, range, workbook, application, etc).


FWIW, when you accidently (or otherwise) end up with an Excel application that is running (evidenced by seeing EXCEL.EXE in Windows Task Manager), but not visible from the screen, you can retrieve that Excel session by using "GetObject" in a Visual Basic script.

  1. Create a new text document
  2. Add the following lines:

Dim eApp

Set eApp = GetObject(,"Excel.Application")
eApp.Visible = TRUE
Set eApp = Nothing

 

3.  Save as a VBS file (GetExcel.vbs)

4.  Double click file to run

 

That should latch onto the open application and modify the visible property.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 12 of 18
(2,264 Views)

I've added a "Save Workspace" node but still get an error after the Worksheet->Range invoke node

0 Kudos
Message 13 of 18
(2,254 Views)

You need to save the opened workbook....not the workspace.  And you need to change the "start row_col" values to 1,1 as 0,0 is not valid in Excel.

 

Capture.PNG

aputman
Message 14 of 18
(2,249 Views)

thanks, i got it working the way i want execpt for one small detail.  I hard-coded a path with a file name in it but it keeps opening a dialogue box asking me which file to open, any clue as to how to remove this?  Again i am going to be calling this VI from TestStand so I don't want to have to select a file each time it opens.

0 Kudos
Message 15 of 18
(2,242 Views)
Solution
Accepted by topic author at2bob

Remove the File Dialog vi at the front of your block diagram.  That VI prompts you to choose a path everytime it is called.

aputman
Message 16 of 18
(2,239 Views)

thanks everyone for the help, got it working

0 Kudos
Message 17 of 18
(2,228 Views)

Why I'm getting error

"Invalid index.

in ExportToExcel (1).vi

"

0 Kudos
Message 18 of 18
(2,117 Views)