Interoperation / Office Integration Topics include: COM, P/Invoke (e.g. Win32 API), marshaling, distributed applications, VBA and interacting with office apps

Go Back  Xtreme .NET Talk > .NET > Interoperation / Office Integration > vb.net vs excel


Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2002, 01:53 PM
Sierra
Guest
 
Posts: n/a
Question vb.net vs excel

I'm puzzeling with vb and excel, and have 2 questions

1 st How can I save the xls file without being prompted that i'm overwriting an existing file..
2nd If i open the saved xls file i have to make the tab visible

Here's a peice of code I used.

Public objWorkbook As Excel.Workbook
Public objworksheet As Excel.Worksheet
Public datum = Date.Today

Private Sub exit_button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exit_button.Click

'Save het exel werkblad als datum.xls
objWorkbook.SaveAs("C:\Program Files\EMTS Laboratory\Enquete\" & datum & ".xls")

'Maakt he geheugen leeg
objWorkbook.Close()
objWorkbook = Nothing
objworksheet = Nothing
GC.Collect()
Appexel.Quit()
'Beeindig het programma
End

End Sub

thank's in advance

Sietze
Reply With Quote
  #2  
Old 10-29-2002, 04:44 PM
Flyguy's Avatar
Flyguy Flyguy is offline
Atari rules!
 
Join Date: May 2001
Location: Babylon5
Posts: 84
Flyguy is on a distinguished road
Default

Code:
' Geen bevestingen vragen
objWorkbook.DisplayAlerts = False

'Save het exel werkblad als datum.xls
objWorkbook.SaveAs("C:\Program Files\EMTS Laboratory\Enquete\" & datum & ".xls")

' Weer bevestingen vragen
objWorkbook.DisplayAlerts = True
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Help In VB.NET MadMaxx Interoperation / Office Integration 3 05-12-2005 09:03 AM
Excel Border from vb.net wildfire1982 Interoperation / Office Integration 1 01-13-2004 10:28 AM
excel .net farshad Interoperation / Office Integration 0 07-28-2003 08:58 AM
VB. net and Excel files hobbes2103 Interoperation / Office Integration 1 07-16-2003 02:30 PM
excel .net farshad Interoperation / Office Integration 0 07-14-2003 03:58 PM

Advertisement:

Powered by liquidweb