saprouzy Posted July 20, 2005 Share Posted July 20, 2005 Hey there,does anyone have a tutorial or something about working with excel through vb?i've found small examples, but i need a more informative documentthanks. Link to comment Share on other sites More sharing options...
egrath Posted July 20, 2005 Share Posted July 20, 2005 Hi,do you intend to use a standalone VB application to modify a excel file or do you want to use vba?If you are using a VB Standalone Application does the System on which it runs has Excel installed? If so, you can use a OLE Connection to remote control excel to do what you want. A few months ago i've written such a thing but i have to look for it - i will then post a example what i've done.Egon Link to comment Share on other sites More sharing options...
saprouzy Posted July 20, 2005 Author Share Posted July 20, 2005 am using this, i think it will be enough for what i want to do, but i don't mind seeing more examples and/or different ways Private Sub Command1_Click()'On Error GoTo err Dim objExcel Dim objWorkBook Set objExcel = CreateObject("EXCEL.APPLICATION") Set objWorkBook = objExcel.Workbooks.Open("C:\test.xls") For i = 1 To 20 For j = 1 To 20 objExcel.cells(i, j).Formula = i & ":" & j Me.Caption = "Testing vb-excel - " & i & ":" & j Next Next objWorkBook.SaveAs ("C:\test2.xls") objWorkBook.Close True Set objWorkBook = Nothing Set objExcel = Nothing' objExcel.quitExit Suberr:MsgBox "ohh nooo! :( look what happened : " & ErrorEnd Subactually my purpose is to avoid designing a Crystal report, similar to excel files that are already done, so i thought about changing the excels directly Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now