|
-
Apr 11th, 2004, 10:27 AM
#1
Thread Starter
Fanatic Member
close,open, edit save show again in webbrowser
a click button on a form will 'close' the webbrowser open the excel form behind the scene edit it ,save and show again on the webbrowser... however i receive this error : "xxx.xls already exist in this location.Do you want to save it..."
when i try to debug it line by line (ie.F8 on this click button) there is no error till the end of the sub!....(the problem lies on the .save statement... wat wnet wrong ....dunnno which object has not close properly...
VB Code:
Dim name1
Private Sub Command1_Click()
With Me.CommonDialog1
.DialogTitle = "Select Office Document to Display"
.Filter = "Excel Documents " & _
"(*.xls)|*.xls|"
.ShowOpen
If .FileName <> "" Then
name1 = .FileName
Me.WebBrowser1.Navigate .FileName
End If
End With
End Sub
Private Sub Command2_Click()
Me.WebBrowser1.Navigate "about:blank"
Dim wat As Excel.Application
Set wat = CreateObject("Excel.Application")
wat.Workbooks.Open FileName:="C:\123.xls"
Range("G9:G10").Select
wat.ActiveSheet.Pictures.Insert( _
"C:\sig.bmp").Select
wat.ActiveWorkbook.Save
wat.Quit
Set wat = Nothing
WebBrowser1.Navigate name1
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate "about:blank"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|