RE: [visualbasic-l] Excel 2007 Throwing Error 462 'Server Error' in a Piece of VB6 Code

Reply from john on Jan 4 at 12:47 PM
Is the Excel 2010 file an XLS file or an XLSX file ?

John Warner

---------------Original Message---------------
From: edgar purdy
Sent: Wednesday, January 04, 2012 12:34 PM
Subject: Excel 2007 Throwing Error 462 'Server Error' in a Piece of VB6 Code

The error says "remote server machine does not exist or is unavailable". A bogus error since everything is being done on my local PC.

I am running VB6 and Excel 2010 The code segment below is where the error is being thrown. This code works with Excel 2003, not with Excel 2007. The error occurs at the line Range("B4:H204").Select
What changes are necessary to make this run with Excel 2007.

Set oWkbobj = CreateObject("Excel.Application")
Set oWkbkObj = oWkbobj.Workbooks.Open(App.Path & \TX_Tests_all_real_data.xls")

oWkbobj.Visible = False

' clear all 32 worksheets
For iIdx = 1 To UBound(tx_wkbk_array)
oWkbkObj.Sheets(tx_wkbk_array(iIdx)).Select
Range("B4:H204").Select
Selection.ClearContents
Selection.NumberFormat = "0.00"
Range("B4").Select
Next iIdx

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
john  

24 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Have a VB Question? Ask Your Peers at Toolbox for IT

_.____.__

No comments:

Post a Comment