fork download
  1. Imports Microsoft.Office.InteropImports
  2. Imports Microsoft.Office.Core.MsoTriState
  3. Imports Microsoft.Office.Interop.PowerPoint
  4. Imports Microsoft.Office.Interop
  5. Imports System.Data.OleDbModule
  6. Imports System.Data.OleDb
  7.  
  8. Module Module1
  9. Sub Main()
  10. Dim myApp = New PowerPoint.Application()
  11. myApp.Visible = msoTrue
  12.  
  13. Dim MyPresentation = myApp.Presentations.Open("C:\Users\owner\Desktop\Trials.pptx", msoTrue, msoTrue, True)
  14. ' get the first slide
  15. Dim MyFirstSlide = MyPresentation.Slides(1)
  16. Dim sqlQueries As New ArrayList
  17.  
  18. Try
  19.  
  20. For i = 1 To MyFirstSlide.Shapes.Item(1).Table.Rows.Count
  21. Dim row = MyFirstSlide.Shapes.Item(1).Table.Rows.Item(i)
  22. 'Get desired values from ppt table
  23. Dim firstColVal = row.Cells(1).Shape.TextFrame.TextRange.Text.Trim()
  24. Dim secondColVal = row.Cells(2).Shape.TextFrame.TextRange.Text.Trim()
  25. 'Build the sql insert command for the db
  26. sqlQueries.Add("UPDATE SHIPS SET PROBLEMS = 'secondColVal' WHERE NAME='firstColVal'")
  27.  
  28. Next
  29.  
  30. ' close presentation
  31. MyPresentation.Close()
  32. 'MSAccess stuff
  33. 'Open connection to db
  34. Dim connection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;data source= C:\database.mdb")
  35. connection.Open()
  36. 'Perform each query one-by-one
  37. For Each query In sqlQueries
  38. Dim cmd = New OleDbCommand(query, connection)
  39. Dim icount = cmd.ExecuteNonQuery
  40. Next
  41. 'Close connection
  42. connection.Close()
  43.  
  44. Catch ex As Exception
  45. MsgBox(ex.Message)
  46. End Try
  47.  
  48. End Sub
  49. End Module
  50.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Visual Basic.Net Compiler version 0.0.0.5914 (Mono 2.4.2 - r)
Copyright (C) 2004-2008 Rolf Bjarne Kvinge. All rights reserved.


/home/HSijc7/prog.vb (1,20) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/HSijc7/prog.vb (1,20) : Warning VBNC40056: The import 'Microsoft.Office.InteropImports' could not be found.
/home/HSijc7/prog.vb (2,19) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/HSijc7/prog.vb (2,19) : Warning VBNC40056: The import 'Microsoft.Office.Core.MsoTriState' could not be found.
/home/HSijc7/prog.vb (3,19) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/HSijc7/prog.vb (3,19) : Warning VBNC40056: The import 'Microsoft.Office.Interop.PowerPoint' could not be found.
/home/HSijc7/prog.vb (4,19) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/HSijc7/prog.vb (4,19) : Warning VBNC40056: The import 'Microsoft.Office.Interop' could not be found.
/home/HSijc7/prog.vb (5,16) : Error VBNC30456: 'OleDbModule' is not a member of 'Global.System.Data'.
/home/HSijc7/prog.vb (5,16) : Warning VBNC40056: The import 'System.Data.OleDbModule' could not be found.
5 errors, but compilation succeeded? Resolve
/home/HSijc7/<MyGenerator> (1,1) : Error VBNC99999: Unexpected error: There has been an internal error in the compiler: Consistency check failed
  at vbnc.Compiler.VerifyConsistency (Boolean result, System.String Location) [0x000a3] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:132 
  at vbnc.Compiler.Compile_Resolve () [0x00070] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:403 
  at vbnc.Compiler.Compile () [0x0028a] in /var/tmp/portage/dev-lang/mono-basic-2.4.2/work/mono-basic-2.4.2/vbnc/vbnc/source/General/Compiler.vb:561 
Compilation took 00:00:00.7036780
stdout
Standard output is empty