Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 17th, 2007, 05:21 AM
Registered User
 
Join Date: Oct 2006
Location: Pune, Maharastra, India.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Unable to save Excel with macro on server

I have my Excel file on my server and i want to access it from client i.e open it and save it on the server itself.
If i use a simple Excel it works properly but if i use a macro and make the excel password protected then it does not allow me to open it.


 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("D:\excelwb\Finance94027_1.xls")

            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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to create Macro valdetero Excel VBA 0 July 26th, 2007 02:58 PM
Save a file in CSV format thru Excel VBA macro roli2712 Excel VBA 1 July 11th, 2007 03:05 AM
Unable to open Excel with macro guptasourav ASP.NET 1.x and 2.0 Application Design 0 January 18th, 2007 01:52 AM
How to Save data through MACRO kotaiah Excel VBA 1 September 21st, 2006 07:23 AM
save Excel spread-sheet to SQL Server ybao Classic ASP Databases 1 July 12th, 2004 03:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.