Caros,
Eu consigo abrir uma planilha do excel pelo xharbour e ler/gravar informações normalmente.
usando o mesmo princípio eu conseguiria abrir o MS- Project no xharbour?
Muito Obrigado
Ler MSProject
Moderador: Moderadores
- Luciano Bonfim
- Usuário Nível 3

- Mensagens: 414
- Registrado em: 23 Ago 2007 09:34
- Localização: Rio de Janeiro / São Paulo
- Contato:
Ler MSProject
Muito Obrigado,
Luciano Bonfim de Azevedo
www.bonfim.com.br
luciano@bonfim.com.br
www.linkedin.com/in/lucianobonfim
Skype : lucianobonfim
Luciano Bonfim de Azevedo
www.bonfim.com.br
luciano@bonfim.com.br
www.linkedin.com/in/lucianobonfim
Skype : lucianobonfim
- rochinha
- Administrador

- Mensagens: 4664
- Registrado em: 18 Ago 2003 20:43
- Localização: São Paulo - Brasil
- Contato:
Re: Ler MSProject
Amiguinho,
Tempos atrás eu fiz um teste, se não me engano com algum recurso do Project 98 instalado via plugin do IE.
Não me lembro de ter gostado do resultado, mas o código para voce pesquisar solução esta aqui:
Tempos atrás eu fiz um teste, se não me engano com algum recurso do Project 98 instalado via plugin do IE.
Não me lembro de ter gostado do resultado, mas o código para voce pesquisar solução esta aqui:
Código: Selecionar todos
/*
* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
* Description: Permite o uso da tecnologia do MS Project
* Jose Carlos da Rocha - Harbour + Fivewin
* *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
*/
Function MSProject( oIEWnd )
LOCAL oChildWnd, oActiveX
LOCAL cHtml
chtml := [ <html><head> ]+CRLF
chtml += [ <meta http-equiv="content-type" content="text/html; charset=utf-8"/> ]+CRLF
chtml += [ <title>Google Maps</title> ]+CRLF
chtml += [</head> ]+CRLF
chtml += [<BODY leftMargin=1 topMargin=1 language="javascript" onload="Init();"> ]+CRLF
chtml += [<button name="Collapse" title="Zoom in" style="height:25; width:25; background:URL(zoomin.gif);" onclick="CollapseTS_onclick();"></button> ]+CRLF
chtml += [<button name="Expand" title="Zoom out" style="height:25; width:25; background:URL(zoomout.gif)" onclick="ExpandTS_onclick();"></button> ]+CRLF
chtml += [<button name="Goto" title="Go to selected task" style="height:25; width:25; background:URL(goto.gif)" onclick="Goto_onclick();"></button><br> ]+CRLF
chtml += [<OBJECT ID="MSPJGrid" CLASSID="CLSID:5531B412-313F-4b42-9B48-0966457AA6FA" ]+CRLF
chtml += [ WIDTH=100% HEIGHT=580></OBJECT> ]+CRLF
chtml += [</BODY> ]+CRLF
chtml += [<script language="javascript"> ]+CRLF
chtml += [//-------------------------------------------------------------------------- ]+CRLF
chtml += [function Init() { ]+CRLF
chtml += [ var adUseClient = 3; ]+CRLF
chtml += [ var adInteger = 3; ]+CRLF
chtml += [ var adDate = 7; ]+CRLF
chtml += [ var adBoolean = 11; ]+CRLF
chtml += [ var adVarWChar = 202; ]+CRLF
chtml += [ var rs = new ActiveXObject("ADODB.Recordset"); ]+CRLF
chtml += [ rs.CursorLocation = adUseClient; ]+CRLF
chtml += [ rs.Fields.Append("WASSN_ID", adInteger, -1, 0); ]+CRLF
chtml += [ rs.Fields.Append("TASK_NAME", adVarWChar, -1, 0); ]+CRLF
chtml += [ rs.Fields.Append("ASSN_START_DATE", adDate, -1, 0); ]+CRLF
chtml += [ rs.Fields.Append("ASSN_FINISH_DATE", adDate, -1, 0); ]+CRLF
chtml += [ rs.Fields.Append("ASSN_WORK", adInteger, -1, 0); ]+CRLF
chtml += [ rs.Fields.Append("ASSN_REM_WORK", adInteger, -1, 0); ]+CRLF
chtml += [ rs.Fields.Append("WASSN_PCT_COMP", adInteger, -1, 0); ]+CRLF
chtml += [ rs.Open(); ]+CRLF
chtml += [ var fieldnames = new Array(); ]+CRLF
chtml += ' fieldnames[0] = "WASSN_ID"; '+CRLF
chtml += ' fieldnames[1] = "TASK_NAME"; '+CRLF
chtml += ' fieldnames[2] = "ASSN_START_DATE"; '+CRLF
chtml += ' fieldnames[3] = "ASSN_FINISH_DATE"; '+CRLF
chtml += ' fieldnames[4] = "ASSN_WORK"; '+CRLF
chtml += ' fieldnames[5] = "ASSN_REM_WORK"; '+CRLF
chtml += ' fieldnames[6] = "WASSN_PCT_COMP"; '+CRLF
chtml += [ var fieldvalues = new Array(); ]+CRLF
chtml += [ var dStart = new Date; ]+CRLF
chtml += [ var dFinish = new Date; ]+CRLF
chtml += [ dFinish.setDate( dFinish.getDate() + 5 ); ]+CRLF
chtml += ' fieldvalues[0] = 0; '+CRLF
chtml += ' fieldvalues[1] = "Task1"; '+CRLF
chtml += ' fieldvalues[2] = dStart.getVarDate(); '+CRLF
chtml += ' fieldvalues[3] = dFinish.getVarDate(); '+CRLF
chtml += ' fieldvalues[4] = 480000; '+CRLF
chtml += ' fieldvalues[5] = 240000; '+CRLF
chtml += ' fieldvalues[6] = 50; '+CRLF
chtml += [ rs.AddNew(fieldnames, fieldvalues); ]+CRLF
chtml += ' fieldvalues[0] = 1; '+CRLF
chtml += ' fieldvalues[1] = "Task2"; '+CRLF
chtml += ' fieldvalues[2] = dStart.getVarDate(); '+CRLF
chtml += ' fieldvalues[3] = dFinish.getVarDate(); '+CRLF
chtml += ' fieldvalues[4] = 960000; '+CRLF
chtml += ' fieldvalues[5] = 960000; '+CRLF
chtml += ' fieldvalues[6] = 0; '+CRLF
chtml += [ rs.AddNew(fieldnames, fieldvalues); ]+CRLF
chtml += [ rs.Update(); ]+CRLF
chtml += [ MSPJGrid.Binding = rs; ]+CRLF
chtml += ' MSPJGrid.FieldList = "#TASK_NAME[Nome da Tarefa]<31>,ASSN_START_DATE[Inicio],ASSN_FINISH_DATE[Termino],WASSN_PCT_COMP[% Completo],ASSN_WORK[Trabalhado],+ASSN_REM_WORK[Faltam]"; '+CRLF
chtml += [ MSPJGrid.Outlining = false; ]+CRLF
chtml += [ MSPJGrid.GanttView = true; ]+CRLF
chtml += [ MSPJGrid.Refresh(); ]+CRLF
chtml += [ } ]+CRLF
chtml += [function ExpandTS_onclick() ]+CRLF
chtml += [ { MSPJGrid.SetCurrentCell(0,2,4); ]+CRLF
chtml += [ MSPJGrid.ExpandTimeScale(); ]+CRLF
chtml += [ MSPJGrid.Refresh() } ]+CRLF
chtml += [function CollapseTS_onclick() ]+CRLF
chtml += [ { MSPJGrid.CollapseTimeScale(); ]+CRLF
chtml += [ MSPJGrid.Refresh() } ]+CRLF
chtml += [function Goto_onclick() ]+CRLF
chtml += [ { MSPJGrid.GotoSelectedTask(); ]+CRLF
chtml += [ MSPJGrid.Refresh() } ]+CRLF
chtml += [</script> ]+CRLF
chtml += [ </html> ]+CRLF
MemoWrit("project.htm",chtml)
/*
DEFINE WINDOW oChildWnd FROM 0,0 TO 600,800 PIXEL TITLE "Google Maps" //MDICHILD STYLE nOr(WS_CHILD,DS_SYSMODAL,DS_MODALFRAME)
oActiveX = TActiveX():New( oWnd, "Shell.Explorer.2" )
oChildWnd:oClient = oActiveX
oActiveX:Do("Navigate2",(CurDrive() + ":\"+CurDir()+"\project.htm"))
ACTIVATE WINDOW oChildWnd
*/
oIE:=TOleAuto():New( "InternetExplorer.Application" )
oIE:Visible := .T.
oIE:ToolBar := .F.
oIE:StatusBar := .F.
oIE:Top := 055
oIE:Left := 001
oIE:Height := 585
oIE:Width := 700
oIE:MenuBar := .F.
oIE:Navigate( (CurDrive() + ":\"+CurDir()+"\project.htm") )
oIE:End()
FindIE(oIEWnd)
SysRefresh()
RETUR NIL
OPS! LINK QUEBRADO? Veja ESTE TOPICO antes e caso não encontre ENVIE seu email com link do tópico para [url=mailto://fivolution@hotmail.com]fivolution@hotmail.com[/url]. Agradecido.
@braços : ? )
A justiça divina tarda mas não falha, enquanto que a justiça dos homens falha porque tarda.
@braços : ? )
A justiça divina tarda mas não falha, enquanto que a justiça dos homens falha porque tarda.