Anthony's VBA Forum Index Anthony's VBA Forum
Where the knowledge is shared
Menu
 Anthony's VBA Forum IndexHome Page
 Anthony's VBA Forum IndexForum Index
FAQFAQ
MemberlistMemberlist
UsergroupsUsergroups
RegisterRegister
ProfileProfile
Log in to check your private messagesMessages
Log inLogin/Out

Quick Search

Advanced Search

Links
Consulting
Products

Who's Online
[ Administrator ]
[ Moderator ]


possible for us use the vb to open application

 
Post new topic   Reply to topic     Anthony's VBA Forum Index -> Portfoilio Optimization
View previous topic :: View next topic  
Author Message
bshaen



Joined: 10 Jan 2005
Posts: 9
Location: malaysia

PostPosted: Mon Jan 10, 2005 10:22 pm    Post subject: possible for us use the vb to open application Reply with quote

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
View user's profile Send private message
Data
Moderator
Moderator


Joined: 06 Oct 2004
Posts: 33
Location: NY

PostPosted: Mon Jan 10, 2005 11:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
bshaen



Joined: 10 Jan 2005
Posts: 9
Location: malaysia

PostPosted: Tue Jan 11, 2005 9:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
bshaen



Joined: 10 Jan 2005
Posts: 9
Location: malaysia

PostPosted: Tue Jan 11, 2005 10:28 pm    Post subject: save marco as exe? Reply with quote

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
View user's profile Send private message
Data
Moderator
Moderator


Joined: 06 Oct 2004
Posts: 33
Location: NY

PostPosted: Wed Jan 12, 2005 10:05 pm    Post subject: Reply with quote

Have you add Excel Object in References?
_________________
Data
Knowledge is Power
Back to top
View user's profile Send private message
Guest






PostPosted: Thu Jan 13, 2005 8:41 pm    Post subject: Reply with quote

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
Moderator


Joined: 06 Oct 2004
Posts: 33
Location: NY

PostPosted: Thu Jan 13, 2005 9:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
bshaen



Joined: 10 Jan 2005
Posts: 9
Location: malaysia

PostPosted: Thu Jan 13, 2005 11:17 pm    Post subject: Reply with quote

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... Smile
_________________
bshaen
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Anthony's VBA Forum Index -> Portfoilio Optimization All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group