Excel Macro in Internet Explorer....can't run
I have created an Excel 2003 (.xls) file (created macro using VBA). The Excel file is protected and has hidden worksheets. When I try to run the Excel macro in Internet Explorer, I get an error message "Method of class "Sheets" failed in object _Global". The macro runs fine in Excel.
I'm guessing that IE doesn't access the worksheets (hidden or otherwise) in the Excel Workbook.
Is there a way to declare the "sheets" or "worksheets" variable in my Excel V开发者_开发知识库BA code so that the Excel macros can run in the IE window as well?
Is there a workaround to fix this problem? I have to run the macro in IE.You can offer your Excelfile for download. This way each user can run it on his/her own machine. Just provide a link to its location on a Web page, then the user can decide to download or run immediately. Naturally any modifications the user does, would not flow back into the source.
I found out what the issue was in my case. When the Excel file is opened in Internet Explorer, the sheets that are being accessed will have to be un-hidden and selected
In my case: Application.ThisWorkbook.Sheets("Hose_Blk_mtrl").Visible = True Application.ThisWorkbook.Sheets("Hose_Blk_mtrl").Select
Also, the Workbook should be "UnProtected" so that the above two lines in code will not generate any error. The Worksheets can be hidden again after the execution of the code by
Application.ThisWorkbook.Sheets("Hose_Blk_mtrl").Visible = False
So, Internet Explore CAN host excel files with in-built Macros.
-Rishi
I don't understand what you're doing. The Excel macros runs only on Excel. May be you download a Excel file, and the macros doesn't run? If you need a macro for IE, [check this][1]
[1]: http://download.cnet.com/iMacros-for-Internet-Explorer/3000-12512_4-10586882.html/"check this"
精彩评论