View previous topic :: View next topic |
Author |
Message |
bshaen
Joined: 10 Jan 2005 Posts: 9 Location: malaysia
|
Posted: Mon Jan 10, 2005 10:22 pm Post subject: possible for us use the vb to open application |
|
|
it's possible for us to use vb to read text file and open it in excel. and make it in exe format so that we can directly open the exe to open the excel?? can u guild me some idea.. thank!! _________________ bshaen |
|
Back to top |
|
 |
Data Moderator


Joined: 06 Oct 2004 Posts: 33 Location: NY
|
Posted: Mon Jan 10, 2005 11:54 pm Post subject: |
|
|
yes, it is possible, though I have not tried that before, but I am sure it is doable.
Before you begin anything major, you can start with code that just open Excel in VB, save the VB into exe file, and then lanuch the exe file to see if Excel come up. If it works, then continue your text exporting coding. _________________ Data
Knowledge is Power |
|
Back to top |
|
 |
bshaen
Joined: 10 Jan 2005 Posts: 9 Location: malaysia
|
Posted: Tue Jan 11, 2005 9:56 pm Post subject: |
|
|
thank a lot, but i have try it by the simple coding just now, but that pop up a error: which is run-time error '429'. activeX component can't create object.
this is the simple coding i tried.
Private Sub Form_Load()
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet")
' Make Excel visible through the Application object.
ExcelSheet.Application.Visible = True
' Place some text in the first cell of the sheet.
ExcelSheet.Application.Cells(1, 1).Value = "This is column A, row 1"
' Save the sheet to C:\test.xls directory.
ExcelSheet.SaveAs "C:\TEST.XLS"
' Close Excel with the Quit method on the Application object.
ExcelSheet.Application.Quit
' Release the object variable.
Set ExcelSheet = Nothing
End Sub
so, can u help me to check what the mistake i make in the coding upon??
thank a lot!! _________________ bshaen |
|
Back to top |
|
 |
bshaen
Joined: 10 Jan 2005 Posts: 9 Location: malaysia
|
Posted: Tue Jan 11, 2005 10:28 pm Post subject: save marco as exe? |
|
|
that is possible for us to save the marco to exe format??? if that is possible, can u guide me some idea. thank!! _________________ bshaen |
|
Back to top |
|
 |
Data Moderator


Joined: 06 Oct 2004 Posts: 33 Location: NY
|
Posted: Wed Jan 12, 2005 10:05 pm Post subject: |
|
|
Have you add Excel Object in References? _________________ Data
Knowledge is Power |
|
Back to top |
|
 |
Guest
|
Posted: Thu Jan 13, 2005 8:41 pm Post subject: |
|
|
yes, i add it already, it's work when i add excel 2003, but it's doesn't work when i add excel 2002, so that have another way to run this program?? the coding will more complicated?? |
|
Back to top |
|
 |
Data Moderator


Joined: 06 Oct 2004 Posts: 33 Location: NY
|
Posted: Thu Jan 13, 2005 9:32 pm Post subject: |
|
|
Is there any reason that you need to add Excel 2003? For the purpose of export or import text, Excel 2002 is good enough. You might also want to post your question in developerfusion.com other Excel VBA forum to get the solution. If you do get your answer, please post it on this message board. _________________ Data
Knowledge is Power |
|
Back to top |
|
 |
bshaen
Joined: 10 Jan 2005 Posts: 9 Location: malaysia
|
Posted: Thu Jan 13, 2005 11:17 pm Post subject: |
|
|
yes, i would like to import external data into excel from read the data from text file. that ok, i will try the site later, thank your advice...  _________________ bshaen |
|
Back to top |
|
 |
|