LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Executable will not WRITE to spreadsheet

Solved!
Go to solution

LV2016.

Application reads from XL spreadsheet, finds a field based on searching row label, pulls and manipulates data, then updates one field of the spreadsheet.

Works like a charm in development mode. I've also ran the exe on the pc running LabVIEW.

 

Transported to target PC, installed runtime libraries. Nothing errors.

Calls spreeadsheet, pulls data as expected but will NOT write back to it!

 

0 Kudos
Message 1 of 15
(3,011 Views)

Are you getting any errors out of your write function? (assuming you are handling your errors).

 

My first guess would be that the file to be written was installed as "read only", and you don't have permissions to write to it.

 

Any further guesses would require a look at your code.

0 Kudos
Message 2 of 15
(3,002 Views)

Depending on what operating system and where you are storing the file, you may not have permission to write to the file. You need to be careful where you place files now in Windows. It does not allow you to edit files in certain locations on your computer without having to do extra work to make it allow access.

Tim
GHSP
0 Kudos
Message 3 of 15
(2,994 Views)

@Murph wrote:

LV2016.

 

Transported to target PC, installed runtime libraries. Nothing errors.

Calls spreeadsheet, pulls data as expected but will NOT write back to it!

 

I don't know what "transported" means. Did you create an installer and install the exe on the target system? What is the actual full path of the file?

0 Kudos
Message 4 of 15
(2,986 Views)

I believe it has something to do with that.

My dev station is Windows7, the target machine is Windows10

I am doing file exchange with a folder called  C:\LN Files

0 Kudos
Message 5 of 15
(2,985 Views)

Yes, newer windows versions discourage the use of the root folder. Does it work if you run the exe as administrator (right-click...run as administrator). Even if you have admin privileges, the exe might not.

0 Kudos
Message 6 of 15
(2,980 Views)

I would create an installer, then select the file you want the user to be able to write to (here it is config.ini) and check the "unlock" button.

 

Capture.png

0 Kudos
Message 7 of 15
(2,970 Views)

@gregoryj:

     Thanks for the picture.  I've built a number of executables, but have not (yet) had to "drill down" to such detail to even realize that all those settings were available.

     My tendency has been to keep "rarely-changed" data, such as Configuration files, in "User-space", either in a defined Public Folder (which is where I tend to install the Executables, e.g. <Public>\LabVIEW Builds\<Project>\<Executable>\<Files go here>) or in a defined Data Folder accessable to the User.  So far, this has worked well and has required little variation in going from Windows XP -> Windows 7 -> Windows 8.x -> Windows 10.  But next week, Microsoft could change the rules yet again ...

 

Bob Schor

0 Kudos
Message 8 of 15
(2,910 Views)

default seems to be c:\users\name\Documents, best chance to have write permissions in there.

Other thing could be the document is not closed i.e. held open by something. Plus firewall/virus scanner paranoia towards your compiled version. Seems Windows 10 blocks more things than WIndows 7.

0 Kudos
Message 9 of 15
(2,906 Views)

Frustrating!

I went back and added a bunch of error traps, LV does not generate the error. It appears to be something with Excel itself.

 

0 Kudos
Message 10 of 15
(2,872 Views)