Pessoal vi um tutorial youtube.com/watch?v=nMs8wD-F54U , e não funcionou o meu access.
1 no formulário fui a Controlos ActiveX-Microsoft Web Browser
2 no código ao entrar coloquei o seguinte:
Alguem sabe o que fiz errado?
Cumprimentos,
Joel
1 no formulário fui a Controlos ActiveX-Microsoft Web Browser
2 no código ao entrar coloquei o seguinte:
- Código:
Option Compare Database
Private Sub ExploradorWeb_Enter()
'Grafico
Dim objHTML As Object
Dim fso As Scripting.FilesystemObject
Dim strHTML As String
' Inicio do HTML
strHTML = "<html>" & vbCrLf
strHTML = strHTML & "<head>" & vbCrLf
' Caragar Bibliotecas
strHTML = strHTML & " <script type=""text/javascript"" src=""https://www.gstatic.com/charts/loader.js""></script>" & vbCrLf
strHTML = strHTML & " <script type=""text/javascript"">" & vbCrLf
strHTML = strHTML & "" & vbCrLf
strHTML = strHTML & " google.charts.load('current', {'packages':['corechart']});" & vbCrLf
strHTML = strHTML & "" & vbCrLf
strHTML = strHTML & "google.charts.setOnLoadCallback(drawChart);" & vbCrLf
strHTML = strHTML & "" & vbCrLf
strHTML = strHTML & "function drawChart() {" & vbCrLf
strHTML = strHTML & "" & vbCrLf
' Caragar Dados
strHTML = strHTML & " var data = google.visualization.arrayToDataTable([" & vbCrLf
strHTML = strHTML & " ['Task', 'Hours per Day']," & vbCrLf
strHTML = strHTML & " ['Work', 11]," & vbCrLf
strHTML = strHTML & " ['Eat', 2]," & vbCrLf
strHTML = strHTML & " ['Commute', 2]," & vbCrLf
strHTML = strHTML & " ['Watch TV', 2]," & vbCrLf
strHTML = strHTML & " ['Sleep', 7]" & vbCrLf
strHTML = strHTML & "]);" & vbCrLf
'configuraçao
strHTML = strHTML & "var options = {" & vbCrLf
strHTML = strHTML & " title: 'My Daily Activities'" & vbCrLf
strHTML = strHTML & " };" & vbCrLf
strHTML = strHTML & "]);" & vbCrLf
'carga do grafico
strHTML = strHTML & "var chart = new google.visualization.PieChart(document.getElementById('piechart'));" & vbCrLf
strHTML = strHTML & "chart.draw(data, options);" & vbCrLf
strHTML = strHTML & "}" & vbCrLf
'Fim codigo html
strHTML = strHTML & " </script>" & vbCrLf
strHTML = strHTML & "</head>" & vbCrLf
strHTML = strHTML & "<body>" & vbCrLf
strHTML = strHTML & " <div id=""piechart"" style=""width: 900px; height: 500px;""></div>" & vbCrLf
strHTML = strHTML & " </body>" & vbCrLf
strHTML = strHTML & "</html>" & vbCrLf
'Criacao do ficheiro
Set fso = CreateObject("Scripting.FileSystemObject")
Set objHTML = fso.CreateTextFile(Bibliotecas \ Documentos & "\index.html", True)
objHTML.Write strHTML
Me.ExploradorWeb.ControlSource = ""
Dim miP As String
miP = Replace(Applications.CurrentProjects.Path, ":", "$")
miP = Replace(miP, "\", "/")
Me.ExploradorWeb.ControlSource = "-'file://127.0.0.1/ & miP & " / Index.html '"
Me.ExploradorWeb.Visible = True
cat.Close
Set cat = Nothing
End Sub
Alguem sabe o que fiz errado?
Cumprimentos,
Joel
Última edição por jfrc1994 em 16/11/2016, 15:54, editado 1 vez(es)