• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with macros in excel sheet

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a web application which opens an excel spreadsheet upon clicking a link.
It all works fine but there are a few macros on the excel sheet and they don't seem to work.
This is the code I use to open the excel sheet:
ServletOutputStream sout = null;
try {
response.setContentType(result.getMimeType());
response.setContentLength(result.getData().length);
sout = response.getOutputStream();
sout.write(result.getData());
sout.flush();
} finally {
if (sout != null) {
sout.close();
}
where the result object has the info for mime type as "application/msexcel" and the data is loaded from the database.
The macros are there but when a button is clicked on the excel sheet
it displays an error saying "the macro sharedobject.do?criteria.object=1234'!clearcontents' cannot be found".
where sharedobject.do?criteria.object=1234 is the original URL for opening the excel sheet and clearcontents is the macro name.
Any help would be appreciated.
 
Megan Hill
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I guess what is happening is that the URL gets displayed in the title of the excel spreadsheet and the macro appends the title to the maro name.
Is there a way to display the file name in the title instead of the URL from where it is downloaded.
Waiting for a response. Thanks
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi megan,
i hope u need to set the header before write to outputstream. by using...

response.setHeader("Content-disposition", "inline; filename="+ FileName);
but before that you need to get the filename.
All the Best.
ravus
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic