|
-
Jul 21st, 2004, 02:57 PM
#1
Thread Starter
Addicted Member
what's wrong with this code
when I use the following code, it seems like visual basic open a read only excel file named "book1.xls", how to avoid this? because I need to write some data into the book1.xls so I don't like it read only.
by the way, I manually created an excel file named "book1.xls" .Is that the reason cause it to be read only when opened by my vb code? Do I need to manually created this excel file first?
any suggestion is helpful!!!
code:--------------------------------------------------------------------------------
Set xl = CreateObject("Excel.Application")
Set xlBook = xl.Workbooks.Open(App.Path & "\book1.xls")
Set xlSheet = xlBook.Worksheets.Add
-
Jul 21st, 2004, 04:36 PM
#2
Lively Member
This needs to be in the 'Classic Visual Basic' forum but here goes anyway....
I tried the code that you have and it works fine. How about
Code:
Set xl = CreateObject("Excel.Application")
Set xlBook = xl.Workbooks.Open(App.Path & "\book1.xls", , False)
Set xlSheet = xlBook.Worksheets.Add
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
|