Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modifying XLS file on the form opened with _webview.vcx
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Modifying XLS file on the form opened with _webview.vcx
Miscellaneous
Thread ID:
00877610
Message ID:
00877610
Views:
121
Hi All,
i wantto open a XLS file via _webview.vcx on the form and wantto modify it after . How ?

also i've tried to open first XLS file and modify and save&close and reopen with form included _webview.vcx but ý couldnt. I couldnt save and close it . My codes like below
SET SAFETY OFF 

SELECT * from data03\School INTO CURSOR CrsResult

LcFile=CURDIR()+'CrsResult.xls'
COPY TO (LcFile) TYPE xl5

#include "excel-all.h" 

		oExcel=CreateObject("excel.application")
		oExcel.Application.ScreenUpdating = .t.
		oExcel.workbooks.Open(LcFile)  
		oExcel.Visible=.t.

oExcel.ActiveWorkbook.ActiveSheet.UsedRange.Borders.Linestyle = xlContinuous
oExcel.activewindow.displaygridlines=.f.  

		oExcel.range("a1").select

		oExcel.selection.entirerow.insert 
		oExcel.selection.entirerow.insert 
		oExcel.selection.entirerow.insert 

		
		oExcel.range("a1").select &&a1 sec
		oExcel.activecell.formulaR1C1='SoykanSoft Web Report' 
		oExcel.activecell.range("a1:h1").merge 
		oExcel.Selection.Font.italic = .t.
		oExcel.Selection.Font.Color = RGB(0,0,0)

  		oExcel.range("a2").select
		oExcel.activecell.formulaR1C1='Sorgulama Sonuçlarý' 
*		oExcel.activecell.range("a1:z1").merge 
		oExcel.Selection.Font.italic = .t.
	    oExcel.Selection.Font.Color =RGB(192,192,192)
		
		oExcel.range("d2").select
		oExcel.activecell.formulaR1C1="R.Date :"
		oExcel.Selection.Font.italic = .t.
		*oExcel.Selection.Font.bold = .t.
		oExcel.Selection.Font.Color =RGB(64,128,128)

		oExcel.range("e2").select
		oExcel.activecell.formulaR1C1="=today()"
		oExcel.Selection.Font.italic = .t.
		oExcel.Selection.Font.Color=RGB(64,128,128)

		oExcel.range("a1:h1").select     &&data headers
		oExcel.Selection.Font.Bold = .f.

dimension SUTUN(254)  && columns
SUTUN(1)="A"
SUTUN(2)="B"
SUTUN(3)="C"
SUTUN(4)="D"
SUTUN(5)="E"
SUTUN(6)="F"
SUTUN(7)="G"
SUTUN(8)="H"
SUTUN(9)="I"
SUTUN(10)="J"
SUTUN(11)="K"
SUTUN(12)="L"
SUTUN(13)="M"
SUTUN(14)="N"
SUTUN(15)="O"
SUTUN(16)="P"
SUTUN(17)="Q"
SUTUN(18)="R"
SUTUN(19)="S"
SUTUN(20)="T"
SUTUN(21)="U"
SUTUN(22)="V"
SUTUN(23)="W"
SUTUN(24)="X"
SUTUN(25)="Y"
SUTUN(26)="Z"
SUTUN(27)="AA"
SUTUN(28)="AB"
SUTUN(28)="AC"
SUTUN(29)="AD"
SUTUN(30)="AE"
SUTUN(31)="AF"
SUTUN(32)="AG"
SUTUN(33)="AH"
SUTUN(34)="AI"
SUTUN(35)="AJ"
SUTUN(36)="AK"
SUTUN(37)="AL"
SUTUN(38)="AM"
SUTUN(39)="AN"
SUTUN(40)="AO"
SUTUN(41)="AP"
SUTUN(42)="AQ"
SUTUN(43)="AR"
SUTUN(44)="AS"
SUTUN(45)="AT"
SUTUN(46)="AU"
SUTUN(47)="AV"
SUTUN(48)="AW"
SUTUN(49)="AX"
SUTUN(40)="AY"
SUTUN(50)="AZ"
SUTUN(51)="BA"
SUTUN(52)="BB"
SUTUN(53)="BC"
SUTUN(54)="BD"
SUTUN(55)="BE"
SUTUN(56)="BF"
SUTUN(57)="BG"
SUTUN(58)="BH"
SUTUN(59)="BI"
SUTUN(60)="BJ"
SUTUN(61)="BK"
SUTUN(62)="BL"
SUTUN(63)="BM"
SUTUN(64)="BN"
SUTUN(65)="BO"
SUTUN(66)="BP"
SUTUN(67)="BQ"
SUTUN(68)="BR"
SUTUN(69)="BS"
SUTUN(70)="BT"
SUTUN(71)="BU"
SUTUN(72)="BV"
SUTUN(73)="BW"
SUTUN(74)="BX"
SUTUN(75)="BY"
SUTUN(76)="BZ"
SUTUN(77)="CA"
SUTUN(78)="CB"
SUTUN(79)="CC"
SUTUN(80)="CD"
SUTUN(81)="CE"
SUTUN(82)="CF"
SUTUN(83)="CG"
SUTUN(84)="CH"
SUTUN(85)="CI"
SUTUN(86)="CJ"
SUTUN(87)="CK"
SUTUN(88)="CL"
SUTUN(89)="CM"
SUTUN(90)="CN"
SUTUN(91)="CO"
SUTUN(92)="CP"
SUTUN(93)="CQ"
SUTUN(94)="CR"
SUTUN(95)="CS"
SUTUN(96)="CT"
SUTUN(97)="CU"
SUTUN(98)="CV"
SUTUN(99)="CW"
SUTUN(100)="CX"
SUTUN(101)="CY"
SUTUN(102)="CZ"
SUTUN(103)="DA"
SUTUN(104)="DB"
SUTUN(105)="DC"
SUTUN(106)="DD"
SUTUN(107)="DE"
SUTUN(108)="DF"
SUTUN(109)="DG"
SUTUN(110)="DH"
SUTUN(111)="DI"
SUTUN(112)="DJ"
SUTUN(113)="DK"
SUTUN(114)="DL"
SUTUN(115)="DM"
SUTUN(116)="DN"
SUTUN(117)="DO"
SUTUN(118)="DP"
SUTUN(119)="DQ"
SUTUN(120)="DR"
SUTUN(121)="DS"
SUTUN(122)="DT"
SUTUN(123)="DU"
SUTUN(124)="DV"
SUTUN(125)="DW"
SUTUN(126)="DX"
SUTUN(127)="DY"
SUTUN(128)="DZ"
SUTUN(129)="EA"
SUTUN(130)="EB"
SUTUN(131)="EC"
SUTUN(132)="ED"
SUTUN(133)="EE"
SUTUN(134)="EF"
SUTUN(135)="EG"
SUTUN(136)="EH"
SUTUN(137)="EI"
SUTUN(138)="EJ"
SUTUN(139)="EK"
SUTUN(140)="EL"
SUTUN(141)="EM"
SUTUN(142)="EN"
SUTUN(143)="EO"
SUTUN(144)="EP"
SUTUN(145)="EQ"
SUTUN(146)="ER"
SUTUN(147)="ES"
SUTUN(148)="ET"
SUTUN(149)="EU"
SUTUN(150)="EV"
SUTUN(151)="EW"
SUTUN(152)="EX"
SUTUN(153)="EY"
SUTUN(154)="EZ"
SUTUN(155)="FA"
SUTUN(156)="FB"
SUTUN(157)="FC"
SUTUN(158)="FD"
SUTUN(159)="FE"
SUTUN(160)="FF"
SUTUN(161)="FG"
SUTUN(162)="FH"
SUTUN(163)="FI"
SUTUN(164)="FJ"
SUTUN(165)="FK"
SUTUN(166)="FL"
SUTUN(167)="FM"
SUTUN(168)="FN"
SUTUN(169)="FO"
SUTUN(170)="FP"
SUTUN(171)="FQ"
SUTUN(172)="FR"
SUTUN(173)="FS"
SUTUN(174)="FT"
SUTUN(175)="FU"
SUTUN(176)="FV"
SUTUN(177)="FW"
SUTUN(178)="FX"
SUTUN(179)="FY"
SUTUN(180)="FZ"
SUTUN(181)="GA"
SUTUN(182)="GB"
SUTUN(183)="GC"
SUTUN(184)="GD"
SUTUN(185)="GE"
SUTUN(186)="GF"
SUTUN(187)="GG"
SUTUN(188)="GH"
SUTUN(189)="GI"
SUTUN(190)="GJ"
SUTUN(191)="GK"
SUTUN(192)="GL"
SUTUN(193)="GM"
SUTUN(194)="GN"
SUTUN(195)="GO"
SUTUN(196)="GP"
SUTUN(197)="GQ"
SUTUN(198)="GR"
SUTUN(199)="GS"
SUTUN(200)="GT"
SUTUN(201)="GU"
SUTUN(202)="GV"
SUTUN(203)="GW"
SUTUN(204)="GX"
SUTUN(205)="GY"
SUTUN(206)="GZ"
SUTUN(207)="HA"
SUTUN(208)="HB"
SUTUN(209)="HC"
SUTUN(210)="HD"
SUTUN(211)="HE"
SUTUN(212)="HF"
SUTUN(213)="HG"
SUTUN(214)="HH"
SUTUN(215)="HI"
SUTUN(216)="HJ"
SUTUN(217)="HK"
SUTUN(218)="HL"
SUTUN(219)="HM"
SUTUN(220)="HN"
SUTUN(221)="HO"
SUTUN(222)="HP"
SUTUN(223)="HQ"
SUTUN(224)="HR"
SUTUN(225)="HS"
SUTUN(226)="HT"
SUTUN(227)="HU"
SUTUN(228)="HV"
SUTUN(229)="HW"
SUTUN(230)="HX"
SUTUN(231)="HY"
SUTUN(232)="HZ"
SUTUN(233)="IA"
SUTUN(234)="IB"
SUTUN(235)="IC"
SUTUN(236)="ID"
SUTUN(237)="IE"
SUTUN(238)="IF"
SUTUN(239)="IG"
SUTUN(240)="IH"
SUTUN(241)="II"
SUTUN(242)="IJ"
SUTUN(243)="IK"
SUTUN(244)="IL"
SUTUN(245)="IM"
SUTUN(246)="IN"
SUTUN(247)="IO"
SUTUN(248)="IP"
SUTUN(249)="IQ"
SUTUN(250)="IR"
SUTUN(251)="IS"
SUTUN(252)="IT"
SUTUN(253)="IU"
SUTUN(253)="IV"

 
oExcel.range( 'a4:'+SUTUN(FCOUNT())+'4').select 
oExcel.Selection.Font.Bold = .f.
oExcel.Selection.Font.Color = RGB(255,255,255) 
oExcel.selection.Interior.Color = RGB(255,0,0)  

   

		oExcel.selection.Borders.Linestyle = xlContinuous    


* --- headers convertiing to UPPER word.....---------------------
oExcel.selection.copy	
oExcel.range("a3").select 
oExcel.activesheet.paste  
oExcel.range("a4").formulaR1C1="=UPPER(R[-1]C)"	 
oExcel.range("a4").select 
oExcel.selection.copy
oExcel.range( 'a4:'+SUTUN(FCOUNT())+'4').select 
oExcel.activesheet.paste
oExcel.range( 'a3:'+SUTUN(FCOUNT())+'3').select 
oExcel.selection.Interior.Color = RGB(255,255,255)  
oExcel.selection.borders.color=RGB(255,255,255)	
*oExcel.Selection.Borders.LineStyle = xlLineStyleNone

*-------------- && FORMATTING NUMERIC VALUES --------------
oExcel.range( 'a4:'+SUTUN(FCOUNT())+'4').select     
num_tut=0
gnFieldcount = AFIELDS(gaMyArray) 
FOR nCount = 1 TO gnFieldcount 
   if gaMyArray(nCount,2)='N'
       num_tut=nCount
  oExcel.range( SUTUN(num_tut)+'5' + ':' +SUTUN(num_tut) + '65536').select      
  oExcel.selection.numberformat="#,##0.00"
*  .RANGE("A:A").NumberFormat = "#,##0"
   endif
endfor  
*--------------------------------------------------------------
oExcel.range( 'a3:'+SUTUN(FCOUNT())+'3').select 
oExcel.Selection.Font.Bold = .f.
oExcel.Selection.Font.Color = RGB(255,255,255)

oExcel.range( 'a4:'+SUTUN(FCOUNT())+'4').select     

		           oExcel.selection.autofilter
		             oExcel.Columns().AutoFit
		            
lnkaysay=RECCOUNT()
oExcel.cells(lnkaysay+6,1).select
oExcel.selection.font.bold=.t.
oExcel.Selection.Font.Color =RGB(128,128,0) 
oExcel.activecell.formulaR1C1="Listelenen Kayýt Sayýsý : "+ALLTRIM(STR(lnkaysay))

oExcel.cells(lnkaysay+7,1).select
oExcel.Selection.Font.Color =RGB(192,192,192)
oExcel.activecell.formulaR1C1="MSExcel Export Utility "

oExcel.range("a5").select && basa don orda kal
oExcel.Application.ScreenUpdating = .T.
*-------------------------------------------

oExcel.WorkBooks.Save()
oExcel.quit() 
oExcel=.null.	


*MyFile = LcFile
*MyFileJustName = Justfname(MyFile)
*If oExcel.ActiveWorkbook.ActiveSheet.Name <> MyFileJustName
*	If File(MyFile)
*		Erase (MyFile)
*	Endif
*	oExcel.ActiveWorkbook.ActiveSheet.SaveAs(MyFile)
*Else
*	oExcel.ActiveWorkbook.ActiveSheet.Save()
*Endif

*oExcel.quit() &&exceli kapatýr
*oExcel=.null.	

		oExcel=CreateObject("excel.application")
		oExcel.Application.ScreenUpdating = .f. &&
		oExcel.workbooks.Open(LcFile) && temp folder dan ac
		oExcel.Visible=.t.
		oExcel=.null.	
It works but not desired . It should first create a XLS file and open and modify then save and reopen modified style on the form via _webview.vcx Navigate() command

Please some help

TIA
Next
Reply
Map
View

Click here to load this message in the networking platform