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. Dim sqlres As String
  18.  
  19. Try
  20.  
  21. For i = 1 To MyFirstSlide.Shapes.Item(1).Table.Rows.Count
  22.  
  23. Dim row = MyFirstSlide.Shapes.Item(1).Table.Rows.Item(i)
  24. 'Get desired values from ppt table
  25. Dim firstColVal = row.Cells(2).Shape.TextFrame.TextRange.Text.Trim()
  26. Dim secondColVal = row.Cells(3).Shape.TextFrame.TextRange.Text.Trim()
  27. 'Build the sql update command for the db
  28. Console.WriteLine("This is val of secondColVal " + secondColVal)
  29. Console.WriteLine("This is val of firstColVal " + firstColVal)
  30. sqlQueries.Add("UPDATE SHIPS SET PROBLEMS = '" & secondColVal & "' WHERE NAME='" & firstColVal & "'")
  31. Next
  32.  
  33. 'MSAccess stuff
  34. 'Open connection to db
  35. Dim connection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;data source= C:\database.accdb")
  36. connection.Open()
  37. 'Perform each query one-by-one
  38. For Each query In sqlQueries
  39. Dim cmd = New OleDbCommand(query, connection)
  40. Dim icount = cmd.ExecuteNonQuery
  41. Next
  42. 'Close connection
  43. connection.Close()
  44.  
  45. Catch ex As Exception
  46. MsgBox(ex.Message)
  47. End Try
  48.  
  49. MyPresentation.Close()
  50.  
  51. End Sub
  52. End Module
  53.  
  54.  
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/p88oVQ/prog.vb (1,20) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/p88oVQ/prog.vb (1,20) : Warning VBNC40056: The import 'Microsoft.Office.InteropImports' could not be found.
/home/p88oVQ/prog.vb (2,19) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/p88oVQ/prog.vb (2,19) : Warning VBNC40056: The import 'Microsoft.Office.Core.MsoTriState' could not be found.
/home/p88oVQ/prog.vb (3,19) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/p88oVQ/prog.vb (3,19) : Warning VBNC40056: The import 'Microsoft.Office.Interop.PowerPoint' could not be found.
/home/p88oVQ/prog.vb (4,19) : Error VBNC30456: 'Office' is not a member of 'Global.Microsoft'.
/home/p88oVQ/prog.vb (4,19) : Warning VBNC40056: The import 'Microsoft.Office.Interop' could not be found.
/home/p88oVQ/prog.vb (5,16) : Error VBNC30456: 'OleDbModule' is not a member of 'Global.System.Data'.
/home/p88oVQ/prog.vb (5,16) : Warning VBNC40056: The import 'System.Data.OleDbModule' could not be found.
5 errors, but compilation succeeded? Resolve
/home/p88oVQ/<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.6537950
stdout
Standard output is empty