By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,201 Members | 937 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,201 IT Pros & Developers. It's quick & easy.

Write to excel file using VB

P: 5
I'm trying to read and write from an excel file using this method..My application can read the excel file without problems but doesn't write anything to the file i want it to write. I've also tried adding a '.Value' to the end, it doesn't seem to help. I have closed the file in the end as well..

Any Suggestions would be very helpful
Expand|Select|Wrap|Line Numbers
  1.     Dim excel_app As New Excel.Application
  2.       Dim xlWkBk As Excel.Workbook
  3.       Dim xlSheet As Excel.Worksheet
  4.       Set xlWkBk = excel_app.Workbooks.Open(ExistingFile)
  5.       Set xlSheet = xlWkBk.Sheets.Item(1)
  6.       rowNum = 12
  7.  
  8. 'read from file
  9. datevalLbl.Caption = xlSheet.Cells(rowNum, 1) ' row 14 col 1
  10.  'doesnt work
  11. xlSheet.Cells(rowNum, 13) = fromText.Text
  12.  
Jul 31 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.