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

  • Replies:5
Velmurugan M
  • 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
amax devs (Android App Makers)
  • 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
Anki Patel
  • 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
Zeeshan_sid
  • Forum posts: 19

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
parkerjo
  • 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
Jimmy_Wick
  • Forum posts: 35

Aug 9, 2022, 9:02:34 AM via Website

Step 1: Access Excel file from storage.
Step 2: Create an Instance having reference to .xls file.
Step 3: Fetch sheet at desired index from workbook.
Step 4: Iterate through rows and cells in the sheet. Iterate through each row in the sheet.

Regards,
J wick

Reply