I am working with access in vb anjd i want to have there be a file in the "\" directory called excel1, how do i do this in my application?
Printable View
I am working with access in vb anjd i want to have there be a file in the "\" directory called excel1, how do i do this in my application?
Your question isn't very clear? Do you want to create a file named excel1 in the same directory as your app?
yes exactly!
also it wont let me do
VB Code:
appExcel.Range("B1").Value = text1.Text
The following link will give you an example of how to do what you're after. HTH :)
http://www.erlandsendata.no/english/vba/adodao/
sort of but i dont really understand it all, and i dont need to use access jsut excel.
If you just want to use Excel then this thread is what you're after.
http://www.visualbasicforum.com/show...ght=save+excel
why cant i use this line
VB Code:
appExcel.Range("B1").Value = text1.Text
?????
If you have declared everything then it should work. Can you post all the code you're working with so we can have a look to see if you may hve over looked something.
VB Code:
'Reference Microsoft Excel 8.0 Library Object or up from your program first Sub command1_click() Dim appExcel As Excel.Application Set appExcel = New Excel.Application appExcel.DisplayAlerts = False appExcel.Visible = False appExcel.ScreenUpdating = False appExcel.Workbooks.Open FileName:="c:\myfile.xls" appExcel.Worksheets("Sheet1").Select Range("A2").Value = text2.Text appExcel.ActiveWorkbook.Close Savechanges:=True appExcel.Quit Set appExcel = Nothing MsgBox "Process Complete!" End Sub
There is nothing wrong with your code???
What line does the error occur?/?
there is no error , but the text doesnt go to the block on the excel form.