RB 2007.1
OSX 10.4.8

I have successfully mastered fiddling with Word documents via RB quite a
while ago. I just tried the same with Excel, and have run into difficulties.
To start, I am running a compiled app, which is located in the 'Office'
folder, as required. No joy. Going back to basics, I resorted to running the
example from the on-line language reference... it fails in the same manner
as my more ambitious projects:

  Dim excel As New ExcelApplication
  Dim book As ExcelWorkbook
  Dim sheet As ExcelWorksheet
  
  excel.Visible = True
  book = excel.Workbooks.Add

*** Fails at the preceding step, with an OLEexception: ***
*** "OLE not supported on this platform" ***
*** Anybody know what's up with that? ***
*** My word-fiddling app works fine. ***

  excel.ActiveSheet.Name = "Expenses Report"
  For i As Integer = 0 To ProduceList.listcount - 1
    excel.Range("A" + Str(i + 1), "A" + Str(i + 1)).Value =
ProduceList.Cell(i, 0)
    excel.Range("B" + Str(i + 1), "B" + Str(i + 1)).Value =
ProduceList.Cell(i, 1)
  Next
  excel.Range("A"+ Str(ProduceList.listcount+1), "A"+ _
  Str(ProduceList.listcount+1)).Value = "Total"
  excel.Range("B1", "B"+ Str(ProduceList.listcount)).Style = "Currency"
  excel.Range("B"+ Str(ProduceList.listcount+1), "B"+ _
  Str(ProduceList.listcount+1)).Value = "=SUM(B1:B" +_
  Str(ProduceList.listcount) + ")"
  
  
Exception err as OLEException
  MsgBox err.message


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to