File created in linux transferred to Windows shows corrupted - linux

I have created an Excel file from delimted text file using awk in linux terminal transferring the same to windows. when opened it shows a pop-up "This file might be corrupted or unsafe.would you like to open?"But on tapping yes I could see data everything is fine as expected.How to avoid such pop-up.
I have tried to convert to .xlsx then I couldn't even see the data
I tried to zip and send then unzip same warning popsup

My guess as to what is going on is that the incoming Excel file is still basically a Linux file, but MS Office, being flexible, is allowing you to open it. For a one time fix, try the following steps from Windows Excel:
Open the Linux Excel file (some_file.xlsx)
Save as another file name (some_new_file.xlsx)
Close Excel
Delete some_file.xlsx and rename some_new_file.xlsx to some_file.xlsx
Now try opening the file again, and hopefully the error message will have gone away.

Related

Excel VBA macro failing to save workbook on coworker's computer, but fine on mine

I'm encountering an issue trying to get some macros and VBA scripts working on a new coworker's computer. I've been using the same code for years on my machine and several others without issue, but when my new analyst tries to run it, it throws an error stating it couldn't save the file. He can manually save the file without issue, but running the script throws the error. The really weird part is that it lists the file path, but replaces the filename with a seemingly random hex byte.
On another file, if he opens it, closes with or without saving, then I open the file and try to save it using a macro, it fails saying "cannot access file...". If I copy and paste the file, open and run the macro again, it saves over the offending file no problem.
We've checked permissions and settings and haven't found anything that was different between the two systems. We're both on VMs. His hardware allowance is less than mine but otherwise they're both IT-managed and identical. I'm at my wits' end... Any advice on what may be the source of my grief would be helpful, even if not a solution.
A couple of things I'd check before trying to step through debugger mode.
Coworker does not have write access to the directory (I think you said you checked already)
The new users' Trust Center Settings are not correct
File > Options > Trust Center > Trust Center Settings... > Macro Settings > Ensure the box is checked to trust the VBA model and that macros are not disabled
The new user does not have the same libraries referenced.
Alt + F11 > Tools > References... > Check if coworkers' libs match yours
Is he using a new/different version of Excel that you? A lot of older code got bojangled when Office 365 hit the scene.
After checking settings, I would ask the following:
What error is thrown when coworker attempts to run the macro?
When does the error get thrown? It could be that you have code that is attempting to edit the file (or has another file stuck in an edit) at the same time you're trying to save it.
I would see why the file name is getting corrupted. It sounds like coworkers' machine is looking to a bit of memory or memory address that is somehow getting forgotten. Like the code is referencing a variable that is out of scope.
User Access Control has been enabled on his VM that is somehow preventing him from saving the file correctly.
Your code does not properly Quit the Excel application, so its still running in the background on coworkers' machine. Have them open/close without saving a file and check Task Manager to see if Excel is still up to confirm

Issue Windows / Excel - Seeing a hidden opended excel file in Python although all instances closed

I have this issue where an Excel file appears to be opened when I use Python although there is no Excel instance running. It is impossible to see it via Windows, even with the hidden files option selected ; only using Python in this case (the last item in the list on the last line of code) :
Moreover, it persits even when I tried the following :
Deleting the file,
Copy/paste the whole folder somewhere else,
Renaming the file,
Rebooting...
This is a nightmare... I can't figure why windows would keep a hidden file openened somewhere.
#Boris
Is there someone who has opened/editing this file on a remote/remote desktop connection?

Excel hangs/crashes while updating external link at file opening

I encountered this weird ass and funny error.
I built a file for data ETL. This one takes in various .csv files, combines them and export new .csv files using VBA. The file is originally named as "xxx Modelling ETL.xlsm". It could be opened normally till one day it hangs or crashes while trying to recalculating something (may be the underground query).
After hours of struggling, I opened the file as a copy (under a new name of Copy of ...). Strangely it ran smoothly, no crash or hang. Then I try rename it by remove the "Copy of" part, then the error occurs again.
I want to share this as there could be someone has the same problem, or someone who could shed some light on this black magic thing.
Some solutions:
Rename the file or move it to local drive instead of Onedrive makes thing works normally again.
Open Trust Center, disable Macro with notification, Trusted Locations, and Trusted Documents. Enable them for specific files when open, not for all.

Saving CSV in UTF-8 on Mac

I am having problems to save a CSV file for Core Data using my Mac, works if I save in Windows computer but not in the MAC. I am using Excel. Every time I run the CSV file saved in MAC there are different errors in the Xcode.
In my experience when you save CSV files in a Mac computer it is always a mess. I had several problems dug in the forums and realize only could save CSV in PC with windows. If you are using UTF-8 in your coreData you can workaround with this, I am doing this for some time and never had problem again in my Mac.The way I do:
Save the .CSV file (comma delimited) in Excel.
Open the .CSV file with (http://www.sublimetext.com/2
File > Save with Encoding > choose the one you want.
Done.
If you have to edit or open the file in Excel, you have to save in Sublime Text 2 again before you drag to your Xcode project.
Forget Windows computers :)
Hope this solve your problem.

Recover unsaved .csv file changes

Does anyone know a way to recover changes made in a .csv that were not saved when excel 2007 was closed.
At the moment, I don't see any way to solve this.
Check all the temporary files created recently. Especially alongside the file you opened. There are a few temp folders in the system that Excel may use. C:\Windows\temp is the main one, but it is usually under the Users folder in later versions of windows. Eg: C:\Users\YourUserName\Local Settings\Temp
If you find any files that look like Excel temps, take a copy and rename the extension and then try to open it.
(Your only real chance is if auto-save kicked in and saved a copy - to a temp file - when you still had your new changes in the document. Otherwise the changes are lost I'm afraid)
If option #1 doesn't resolve your problem in Excel, go to File->Options->Save. Hopefully your AutoRecover file location, under the third box, will be populated with an address.

Resources