LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Sam is offline
external usenet poster
 
Posts: 2
Default Button fails to call macro when open an Excel file from web

I got it fixed. I've managed to remove the part after "?" in my
servlet request and the browser shows like
"http://myhostname:myportnumber/mywebapp/reportaction.do". Then the
button works.
It seems the Excel doesn't like "?" in its file name, I guess.

This question was posted for 6 days and nobody seems interestd in it.
Maybe it's not funny enough.

Hope it may give a hint to those who encounter the similar issue.

Thanks
Sam


(Sam) wrote in message . com...
I have an Excel file with a button to run a macro: select sheets and
print preview. It works when the file is opened with Excel. The macro
is simple:
Sub PrintMacro()
Sheets(Array("tables", "data", "charts")).Select
Sheets("tables").Activate
ActiveWindow.SelectedSheets.PrintPreview
End Sub

I need to open it from web. When user selects the file, the web app
retrieves the file and responses to open an Excel file. So I built a
web app using Weblogic and Struts. After user clicks the link to the
file, an Excel file was loaded from the server with chart, data, and a
button to trigger the macro. The title bar shows: Microsoft Excel -
http://myhostname:myportnumber/myweb...?file=20040624
[Group] [Read only]. It works so far.

But when click the button, an Excel message box appears: The macro
''reportaction.do?file=20040624'!PrintMacro' cannot be found.
If look into Tools/Marco, PrintMacro can be found in 3 "Macros in"
status: 1. All Open Workbooks, 2. This Workbook, and 3.
reportaction.do?file=20040624. Click Run in Macro window, it runs in 3
status. Or if the file saved and reopend, click the button and it
works.

Could anyone know why is it and the way to solve the problem?

Thanks so much!
Sam

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I call IE browser (Back button) through Excel macro? SAM SEBAIHI Excel Discussion (Misc queries) 0 December 13th 06 04:50 AM
Button fails to call macro when open an Excel via Intranet tigertax Excel Discussion (Misc queries) 1 April 12th 05 10:21 AM
.ONACTION macro call fails Wayne Excel Discussion (Misc queries) 2 March 2nd 05 05:10 PM
Excel 2003 Workbooks.Open with CorruptLoad=xlRepairFile fails on Excel 5.0/95 file due to Chart, with Error 1004 Method 'Open' of object 'Workbooks' failed Frank Jones Excel Programming 2 June 15th 04 03:21 AM
How to call File Open / Save Window in a Macro [email protected] Excel Programming 1 January 28th 04 03:46 PM


All times are GMT +1. The time now is 08:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"