Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > Other ASP.NET > ASP.NET 1.x and 2.0 Application Design
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 18th, 2007, 01:52 AM
Registered User
 
Join Date: Oct 2006
Location: Pune, Maharastra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to open Excel with macro

I want to open an Excel file on server, make some changes to it, save with some other name(on the server itself) and then to open it on my local machine.
If i use a simple Excel(without macro and with password) it works properly but if i use a macro and make the excel password protected then it does not allow me to open it.


It does not give any exception.
The code gets hang at "oXL.Workbooks.Open"



 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            Dim oXL As New Excel.Application
            Dim oWB, oWBNew As Excel.Workbook

            oWB = oXL.Workbooks.Open("\\infpu05019\KnowledgePlanner\ VashiProjects\CX_ADM\PDLC\Coding\SOURCE\CVXGENERAT EEXCELFORTRACK\RESOURCES\Filebag\Finance94027.xls" , , , , "Password")

            oWB.SaveAs("\\infpu05019\excelwb\Finance94027_1.xl s")

            oWB.Close()
            oXL = Nothing

            Dim OXL2 As New Excel.Application

            Response.Clear()
            Response.ContentType = "Application/vnd.ms-excel"
            oWBNew = OXL2.Workbooks.Open("\\infpu05019\excelwb\Finance9 4027_1.xls", , , , "Password")

            oWBNew.Save()
            oWBNew.Close()
            OXL2 = Nothing

        Catch ex As Exception
            Response.Write(ex)
        End Try

    End Sub

sourav gupta
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to open excel file thru vb.net sreeramulu Javascript 5 December 6th, 2013 04:19 AM
Unable to create Macro valdetero Excel VBA 0 July 26th, 2007 02:58 PM
Unable to save Excel with macro on server guptasourav Classic ASP Basics 0 January 17th, 2007 05:21 AM
Could not open macro storage tigerkit Beginning VB 6 7 September 20th, 2006 02:56 PM



All times are GMT -4. The time now is 03:56 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.