LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel Basic

Dear Experts,

I have problem in the excel visual basic when I €˜Add workbooks it will show error €˜-2147023067 with description €˜Automation Error. This error occurred in few computers with windows 98 OS only. Part of my source code for excel basic here. What could be the problem? Please kindly guide me how to rectify the error.

Dim ExcelWorkbook As Excel.Workbook
Dim ExcelSheet As Excel.Worksheet
Set ObjExcel = GetObject("Excel.Application")
If ObjExcel Is Nothing Then
Set ObjExcel = CreateObject("Excel.Application")
End If
If ObjExcel Is Nothing Then
MsgBox "You must have Microsoft Excel 97 or 2000 loaded on this machine to use this sample", vbOKOnly + vbCritical, "Error"
Exit Function
End If

Set ExcelWorkbook = ObjExcel.Workbooks.Add 'error occured here

Set ExcelSheet = ExcelWorkbook.Worksheets(1)
ObjExcel.Visible = True
ExcelSheet.Visible = xlSheetVisible
ExcelSheet.Cells.Font.Name = "Arial"
ExcelSheet.Cells(1 + j).ColumnWidth = 3 'Line Number
ExcelSheet.Cells(2 + j).ColumnWidth = 7 'Model Number

I would appreciate if I get the guidance .
Thanks and Regards with
Ganesan Thirumavalavan.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel basic quiz Excel user Holmes Excel Worksheet Functions 2 January 16th 10 10:16 PM
excel 2007 basic help Regivicious Charts and Charting in Excel 4 October 23rd 07 09:23 PM
Visual BASIC in Excel Emerogork via OfficeKB.com Excel Worksheet Functions 1 August 27th 07 04:53 PM
Very Basic Excel Tutorial DanielleF Excel Discussion (Misc queries) 0 June 12th 06 11:34 PM
Excel and Visual Basic \remy khalil via OfficeKB.com\ Excel Discussion (Misc queries) 1 July 7th 05 01:05 PM


All times are GMT +1. The time now is 09:17 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"