Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem writing an Excel file on server using Microsoft.ACE.OLEDB.
Hi,
I want to write an excel file on server from a client connection with following code: string ConnString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath("../../ExcelTemplate/PrevalenceReportDownloadv2TEMPLATE.xls") + @";Extended Properties=""Excel 12.0;HDR=NO;"""; OleDbConnection cn = new OleDbConnection(ConnString); cn.Open(); But, it fails to open the connection, giving following error: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine One thing here to note down is, the server has no office environment. Does it need Office installed as a prerequisite ? Or there is some other problem? Hoping for a quick response. Thanks for your help. -Sulakshana. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
problem writing an Excel file on server using Microsoft.ACE.OLEDB.
If I understand you correctly, something like this may get you started:
Private Sub CommandButton2_Click() Dim p As String Dim f As String Dim s As String Dim r As String Dim ws As Worksheet p = "\\fsrv3\public\Sales Operations\Ryan\" f = "East.xls" s = "VP of Sales" r = "I18:K20" Set ws = ActiveSheet Workbooks.Open (p & f) ' copy range values from current worksheet to same range in network file ws.Range(r).Copy Workbooks(f).Worksheets(s).Range(r) ' close network file, saving changes Workbooks(f).Close True End Sub Obviously, change to suit your specific situation! Goodluck, Ryan--- -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "SN" wrote: Hi, I want to write an excel file on server from a client connection with following code: string ConnString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath("../../ExcelTemplate/PrevalenceReportDownloadv2TEMPLATE.xls") + @";Extended Properties=""Excel 12.0;HDR=NO;"""; OleDbConnection cn = new OleDbConnection(ConnString); cn.Open(); But, it fails to open the connection, giving following error: System.InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine One thing here to note down is, the server has no office environment. Does it need Office installed as a prerequisite ? Or there is some other problem? Hoping for a quick response. Thanks for your help. -Sulakshana. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Microsoft.ACE.OLEDB.12.0 - BUG | Excel Discussion (Misc queries) | |||
Microsoft.Jet.OLEDB error with csv file names | Excel Discussion (Misc queries) | |||
Review of Microsoft.Jet.OLEDB.4.0 Connection | Excel Programming | |||
Import data from Microsoft SQL Server into Microsoft Excel | Excel Programming | |||
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the l | Excel Programming |