ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Excel.Application (https://www.excelbanter.com/excel-programming/288652-vba-excel-application.html)

Peter Judson

VBA Excel.Application
 
I have created an web application which creates an Excel Workbook on a
server and then a link to the created workbook. If works fine on our
main web server however on local copies of the application , an out of
disc space error is appearing when creating the new workbook. Example
code is shown below.Class ExcelGen

Private objExcel
Private objWorkBook
Private objSheet
Private iColOffset
Private iRowOffset
Private strTmpdir
Private strFilename

Sub Class_Initialize()
rem On Error Resume Next


<%

iColOffset = 2
iRowOffset = 2

Set objExcel = CreateObject("excel.Application")
if (err.Number < 0) Then Exit Sub

objExcel.Visible = false
objExcel.DisplayAlerts = false

Set objWorkBook = objExcel.Workbooks.add -- Fails here
if (err.Number < 0) Then Exit Sub


The Excel object has been instanced as I can display the properties
Displayalerts and Visible

Any ideas !!

Henry[_5_]

VBA Excel.Application
 
Peter,

You can use
Set objWorkBook = New Excel.Workbook

HTH
Henry

"Peter Judson" wrote in message
om...
I have created an web application which creates an Excel Workbook on a
server and then a link to the created workbook. If works fine on our
main web server however on local copies of the application , an out of
disc space error is appearing when creating the new workbook. Example
code is shown below.Class ExcelGen

Private objExcel
Private objWorkBook
Private objSheet
Private iColOffset
Private iRowOffset
Private strTmpdir
Private strFilename

Sub Class_Initialize()
rem On Error Resume Next


<%

iColOffset = 2
iRowOffset = 2

Set objExcel = CreateObject("excel.Application")
if (err.Number < 0) Then Exit Sub

objExcel.Visible = false
objExcel.DisplayAlerts = false

Set objWorkBook = objExcel.Workbooks.add -- Fails here
if (err.Number < 0) Then Exit Sub


The Excel object has been instanced as I can display the properties
Displayalerts and Visible

Any ideas !!





All times are GMT +1. The time now is 01:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com