Opening excel in android app -( Not read/write of excel)

  • Replies:5
  • Forum posts: 1

Jan 6, 2016, 7:40:32 AM via Website

Hi Devs ,

I was searching and searching for the simple activity which is just opening the stored xls using code.
What i did us i converted DB values in excel to print out , My code nicely created the excel in mentioned path but i need to open it and show also.

I am using this code. once excel is constructed ,

File file = new File(Environment.getExternalStorageDirectory().toString() + "/test.xls");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.ms-excel");
startActivity(intent);
But the newly created excel is not opening .

I think this is very usual activity. Am i overlooking it ? any simple way of doing it ?
Please help , I stuck with this for 3 days.
Thanks a lot

amax devs (Android App Makers)

Reply
  • Forum posts: 1

Feb 14, 2016, 1:01:17 PM via Website

I am having same problem. Google sheets cant be opened directly after creating it. but it opens from file explorer.

Reply
  • Forum posts: 1

Nov 13, 2017, 5:25:53 AM via Website

Did you get any type of solution of your problem ?
Please help, i've same situation in my project.

Reply
  • Forum posts: 23

Mar 20, 2020, 7:14:19 AM via Website

I encounter the same problem. You should download the Microsoft Excel application. I think Google sheets create an issue in mobile but run smoothly on the desktop.

Reply
  • Forum posts: 11

Dec 23, 2020, 3:45:31 PM via Website

I also don't know how to solve this problem. Sometimes my excel doesn't even open.

Reply