Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Include An Excel File In VB Application


Dear All,

We have a MS Excel with macro, that is doing some calculation and
generate an output. Now we want to do something similar in a VB 6
application. Is there a way to simply involve the specific Excel file in
VB, instead of implementing all the logic again? Is there any good
example?

TIA!




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
What File To Include For Crystal Report 8 When Package The Application Setup?
I have include crystal.ocx when package the vb6 setup, but the crystal report is not working in client place?
what file else should i include?

Help!!!

thanks

wee

Word Include Excel File
Hello,

I am a guy from Germany and need your help.

I have this simple code:

-------------------------------------------------
SET myWord = CreateObject("Word.Application")
SET myDoc = myWord.Documents.Open ("C:ProjectsRechnungmuster.doc")
SET myRange = myWord.ActiveDocument.Range(0, 0)

myWord.Visible = true


??? EXCEL CODE ???


myWord.ActiveDocument.Close
myWord.Quit
SET myWord = Nothing
-------------------------------------------------

I only want a white empy word document (which this code generates already) and on this document embedded a excel document (path: C est.xls).

How should I make this?
Some example code would be fine! Thank you all!

Sven.

Packaging VB6 Application (what To Include?)
Hello Goup,

Some avice about packaging a VB application if I can.

I just used a third party dependancy program to find out what files were being used by my application.

File Name Size Version
c:WindowsSystemWinmm.dll= 64KB 4.03.1998
c:WindowsSystem abctl32.ocx = 205KB 6.00.8804
c:WindowsSystemRichtx32.ocx= 200KB 6.00.8804
c:WindowsSystemRiched32.dll= 171KB 4.00.993.4
c:WindowsSystemMsvbvm60.dll= 1,3566.00.9237
c:WindowsSystemmsdxm.ocx= 827KB 6.4.07.1121
c:WindowsSystemComdlg32.ocx= 138KB 6.00.8418


Which of the above files should I include in the package?

Also, I am using the Wise install system. They have an option to self register files. Is it this a good idea to use this feature? can it do any harm?

Thanks in advance.

Regards
Jeff

Include Wav Files With My Application
I am tring to include wav files with my app.
after I compile my app and package it with the wav. files
I can't get the files play when the app is installed on a other
computer. I am using the App.Path in my code but that does not work. can someone tell me what I am doing wrong

Include Sound W. Application And Gif
ok 2 questions ,

1st: first of all is there anyway to add sound to an application so that they dont have to have it on their computer, it just is loaded in the program.

2nd: how do i add a gif ( yes i did search and i dont understand VB language very well so i dont understand what you mean.)

How Do I Include Sound In My Application?
How do I include sound in my Application? or avi files?(please include a code with your answer)

How To Include .gif Files Into My VB Application
Hi,
How to include a gif file into my VB application. Will it affect the performance of the application? I mean interms of loading speed and run time speed.

Thanks and regards,
Girish V

How Do I Include An Offline Website In An Application?
I'm writing a program that opens an offline website that is stored on the user's hard disk.

Two questions:
a) how do i refer to the website within the code which is stored in the root folder. I have tried the following:

Dim WebRoot as String
WebRoot = "c:siteoffline"

but this does not work

b) Secondly, how do I ensure the website is included in the package, and installed to a given path on the user's computer when I finish the project?

I will be eternally grateful to anyone that can help.

Cheers
Andrew

WANG ImgEdit Control : Do I Need A Licence To Include This OCX In My Application ?
IDo I need a licence ? If so How to get it ?

If VB include an OCX file to add to VB Application, is a license necessary ?


Anyone know the answer to this Riddle ?


R:-).....................................................

Excel File Without The Overhead Of Excel Application.
I need to write a routine that can create an excel file, even if the user doesnt have excel installed, hence I can't just reference excel in my application.
Is there a document outlining the excel format or something I can do to write an excel file without referencing the application. (I don't need to read the file, the file is sent off to someone else later.)

How To Detect The Requirements Files Of My Application For Include To INNO SETUP Prog
How to detect the requirements files of my application for include to INNO SETUP program?
Thanks

Include Text In Cell Of Excel
I want to include a text into a cell of Excel. I have resize the width of a cell but i dont know how many rows must be merge vertical from that cell and below for view all the text (the text maybe has many lines). Of course after merge of cells i have set the word wrap. How to know how many cells must be merge vertical for view all the text?
Thanks

Opening Excel Doc With VB6, Must Include Addins
As in, I need the excel doc to be opened by VB 6, but currently there is no add-ins installed with it!

If I open a workbook directly OR from another excel workbook... the addins are automatically there... what am i doing wrong?

Thanks in advance.

Creating A New Excel File Through My Application
I am using the following line to create a new .xls file

GenFileFromRes 101, "XLS", "XLS", , , fNAME

the error I get is "Resource with resource id 101 not found"
what may be the problem? GenFileFromRes is given below

Public Function GenFileFromRes(resID As Long, resSECTION As String, fEXT As String, Optional fPath As String = "", Optional fNAME As String = "temp", Optional FullName As String = "") As String
On Error GoTo ErrorGenFileFromRes
Dim resBYTE() As Byte
If fPath = "" Then fPath = App.Path
If fNAME = "" Then fNAME = "temp"
'------------------------------------------------------------
' Get the file out of the resource file
'------------------------------------------------------------
resBYTE = LoadResData(resID, resSECTION)
'------------------------------------------------------------
' Open destination
'------------------------------------------------------------
If FullName = "" Then
Open fPath & "" & fNAME & "." & fEXT For Binary Access Write As #1
Else
Open FullName For Binary Access Write As #1
End If
'------------------------------------------------------------
' Write it out
'------------------------------------------------------------
Put #1, , resBYTE
'------------------------------------------------------------
' Close it
'------------------------------------------------------------
Close #1
If FullName = "" Then
GenFileFromRes = fPath & "" & fNAME & "." & fEXT
Else
GenFileFromRes = FullName
End If
Exit Function
ErrorGenFileFromRes:
GenFileFromRes = ""
MsgBox Err & ":Error in GenFileFromRes. Error Message: " & Err.Description, vbCritical, "Warning"
Exit Function
End Function

Opening Excel File In A VB Application
can you give me the code for opening the EXCEl file in my VB application and to :
1> Access a particular cell in the worksheet
obtain its contents
change its contents
2.> Apply the above to a range of selected cells
3.> sum the entire Column , part of the column

Please give the code as I am new to VB

Runtime Connecting Excel File To VB6 Application
Hello,

After two full days of continuous searching/trying/reading/experimenting I hope to find an answer to my problem in this forum.

I like to connect an arbitrary Excel file to my VB6 application at RUNTIME and automatically connect textboxes or any other data-modifying-object to Excel fields to modify the Excel data.

I manged to do this at designtime but I do not find any solution to connect/disconnect an Excel file at runtime.

Any tip is appreciated very well.

Regards,

Henk

Include External Code In Excel Macro Script
Hi,

I have made a large Macro for Excel for some reporting application.
I am loking for an Include statement to include an external *.bas file in the code.
The reason I want to do this is so the code in the excel file can include the remote file. Then when I need to update the source code, everyone using the excel file will have the updated source code without re-downloading the excel file again themselves.

Can anyone pleas advise how I can do this in VB?

Thanks in advance.

Excel Challenge: Include A Procedure That Generates A Project Plan
Hi,
I have a great Excel challenge.
I did a program, that filters my activities that I want to carry out. I also have the times of these activities.
Now I need a program that shows me theactivities in a calendar, including weekends and holidays. Itīs supposed to be very similar to MS Project.
Is there a calender function in Excel that I could use?
Or could I import from MS Project?
For now, I donīt really have an idea yet and really appreciated any advice!
Thanks!
Claudia

Save Data To Excel File Using Visual Basic Application
Hi,

I have no idea how to save data to excel file via visual basic application, do you guys have any usefule link or example for me to refer. It is urgent.

Thanx

Replace Excel File With Visual Basic Application Problem
Code:
'Create a Recordset from all the records in the Orders table
Dim sNWind As String
Dim conn As New ADODB.Connection
Dim RS As ADODB.Recordset
sNWind = "C:Northwind.mdb"
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sNWind & ";"
conn.CursorLocation = adUseClient
Set RS = conn.Execute("Orders", , adCmdTable)

Dim oExcel As Excel.Application
Dim oBook As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim ExcRng1 As Excel.Range
Set oExcel = New Excel.Application
Set oBook = oExcel.Workbooks.Add
Set oSheet = oBook.Worksheets(1)

Set ExcRng1 = oSheet.Range("A1")
ExcRng1.Value = "Hello World"

'Transfer the data to Excel
oSheet.Range("A2").CopyFromRecordset RS

'Save the Workbook and Quit Excel
oBook.SaveCopyAs "C:Book1.xls"
oExcel.Quit

'Close the connection
RS.Close
conn.Close

i am be able to replace the existing Book1.xls in c drive with new books1.xls. This is because of i am using SaveCopyAs method.

But my problem is it will pop up another confirmation windows and asking 'Do you want to save the changes you made to 'Book2'?' (refer to the attachment).

How to overcome this problem so that the confirmation window not pop up again because i dun want to save the 'Book2' and i dun need the 'Book2'?

Howto Get Excel To Open A File Name That Is Listed In A Textbox Within My Application
I am very new to programming (obviously).
I am attempting to make a stand alone application that will open Excel and then cause Excel to open a file on the A drive. The first step I have figured out. I can get the program to launch Excel.
Now I am trying to get excel to open a file name that is listed in a textbox within my application. I can’t figure out how to get this to happen.
Could someone suggest some code that will help me change focus to excel, and then open a file… ?
Thanks in advance for any help.

Include Mdb File?(vb6)
hi,
my exe uses an access database, but the deployment wizard doesnt include the .mdb file automatically.
do i have to add the .mdb manually, so the deployment wizard can assamble the cab file with the .mdb file, or should i let it untouched?

bye
mirza

How Do You Include A File In A VB App??
I am writing a quiz program, where the question sets are stored in a seperate file each. The way i want to do it is so that, the questions could be stored in a text file which would look similar to this:

ArryQuestion(0, 0) = "1)Who is legally authorised to direct traffic?"
ArryQuestion(1, 0) = "2)Which is the main cause of rear-end collisions?"

And so on....

I just want a way so that i can include one of these text documents in my VB code. Similar to how you would do SSI (Server side includes). I don't remember how to do them something like "<!--#Include filename -->

Anyway if you know how they work then that is what i am trying to achieve. I would prefer just some general guidance on how you include these files, rather that somebody coming here and just telling me how to load the files. If anybody can help i appreciate it ever so much.

Kind regards,
Daniel

Include In The Exe A File...
Hi i want to include in my project.exe a 7.8kb files...

should i code a procedure that have the text contained in that 7.8kb file...

#1 i don't want it to be a file required to run the exe file so if someone accidently or volentary deleted the file, the program will recreate it???

it a txt file that have all the streets of the custumers...
and i load it in a combobox...

only problem is that 7.8kb is too big for the procedure...
should i split it in multiple string or is there a better way...

i seen somewhere that we could include zipped files to the program and it will unzip it after?!?
any idea out there...

i know my english is awful, there is no need to say it...

Include File
I was grateful that someone so graciously gave me a JavaScript calendar program. What I would like to know is it possible to include this file in my VB program. So when I click on a command button it will open the file and exe the calendar?

thanks in advance annie

How Do I Include A File In The Exe
Hi,

been searching the db for an answer but without luck so I ask you ppl.
How do I include a file in the compiled exe.

I have program that uses an access database. But I don't want them in two files when the program is done. Must be some way of doing it...

Thanks alot

Include File
Hello,

Can someone tell me how to include a file in a program

which means that when the user clicks a buttom as an example the file is openned but i dont want the file to be opened seperately which means that the user should open the file through the program...

i hope u could understand what i want

thanx alot
urs
Adel

Include File
I was grateful that someone so graciously gave me a JavaScript calendar program. What I would like to know is it possible to include this file in my VB program. So when I click on a command button it will open the file and exe the calendar?

annie

Include .dll In Exe File
My program requires the user to have a certain .dll (Scripting Runtime). Without it, they get a message regarding "missing dll". If I allow VB to make a setup file then it includes the necessary .dll's but the file is 4mb. The regular exe on my hard drive is only 100k. Is there a way to include dll's in my exe without making a huge setup.exe file?

Can I Include A File In VBA
Can I use a kind of include statement for importing other basic files?
like #include for C/C++??

How To Include A File In Vb6
Hi - I have a couple hundred vb6 activex dlls that all have the same constant declarations (named, defined subscripts for a particular array that is used in every one of these activex objects) or a module that includes those same declartions. There didn't start out with so many objects obviously, but they have grown to such a large number, that it has become a huge, time consuming pain to update every one of these every time I need to add a new subscript. Is there any way for me to just create one file containing these declarations, that I can just somehow include in each of my objects so that when I need to add a new subscript, all I need to do is just update the one file, which every object will then already be using?
Thanks!

Include A Txt File
Hi,

Is it possible to "include" a txt file, let's say test.txt in my project.
I'm now opening a file for reading with:
Open "C:projectprogram est.txt" for input as #1


But I want to be able to open the file for reading without specifying to whole path, but just specify the filename only.
I'm asking this because my project will be copied several times and every time in a different directory.
Open "C:project1program est.txt" for input as #1


Open "C:project2program est.txt" for input as #1


Open "C:project3program est.txt" for input as #1


When my project becomes very large with multiple files to be opened, I don't want to get errors and change the pathnames everytime for all the files.

Does anyone have I solution how I can handle this problem?

Thanx,
Maarten

How To Include A Font File (*.ttf) Into A Resource File (*.res)
How to include a font file (*.ttf) into a resource file (*.res)

Please Help.

What Not To Include In A Setup File
Does anyone know of a good list of problem dll's, ocx's etc that should be left out of a setup file?

In other words, files that should not be distributed with an app even if the deployment wizard adds them.

Example:

msvcrt.dll
shlwapi.dll

Re's
Rob

How To Include A Config File?
well i have this question since a while ago. I wanted to include a config file in a little program i want to make, if anyones knows how to it please help me =P

Include HTML File In EXE
Hi guys!
It's been a long time! I have my VB knowledge a bit rusty...

I'm developing a very strange application by demand. I need to include a web file (.HTML) in my project and load it in a WebBrowser control. I know how to load files or urls in the webbrowser control, but I don't have any idea on how to embed a file in the project and load it.
I tried the Resource Editor but it doesn't seem to work...

So I'm a bit lost...


NEED HELP HERE!!!

How Can A Include A Bmp Image In A File?
I make a program who contain a image and a text description.
How can a save this information (bmp image and text) in a single file?
After I open this file, I want to display bmp image and text.

Thanks and sorry for my english.

iepurasul (bunny)

How To Include A DLL File In My Program.
I have a few of my users having an error, that "msstdfmt.dll" cannot be found.

Going to Start, then RUN and typing in "regsvr32.exe msstdfmt.dll" works for most of them.
But, some dont seem to have the file at all.

How do I include this dll file INSIDE the exe file?

Thanks alot.

How To Include Several Files In One File
Hello There,
Can any one please tell me how to include several files in one file. All I want is, I want to make one file containing all my crystal report files. I know we can include several bitmaps in a resource file but i dont know how to have other file types (such as this Crystal report files) in one file. Please Help me with this thing. THANKS!!!

How To Include A File In A Project
hi

i have to play a midi file, so i have added the mediaplayer component.
now before i play the file, i have to write the path of the midi file
so when i build the project, there are 2 files on the harddisk:
the exe file created and the midi file the if is deleted the program don't work.

so i want to know if i can include the midi file in the final exe file
so that, there is only 1 file on the hard disk:
exe file

when i open exe file, the midi is played

thanks

How To Include Animated Gif File
Hi , Every Body
Please help....

How Can run Animated Gif File In Vb Form?
Thank in adv for help....

How Do I Include An Xls File In A Complied .exe ?
Hello,
I have written a small interface program to be used mainly as a validation tool. When filled, A command is run that checks all of the values and then writes them to the appropriate cells in an XL sheet. This XL sheet is formatted in a certain way, so I have an empty template that my program loads, then fills, then saves to disk. The way I have it set up now is, the XL file is in the folder with the .exe and if it isn't there, then the program will not complete because it has nothing to write to.

What I want to do is somehow incorporate the xls file into the .exe so that it does not need to reside anywhere else on the system, thus making the app totally independent. I'm not sure if this is possible or not. Any replys will be appreciated. Thanks.

Is There A Way To Include Pictures With An .exe File?
I have made a program that uses about 6 .jpg images in it. When I make the .exe file, does it include the images, or do I have to package them with the .exe for the program to work? I have used WinZip to make a self extracting file, but it then will extract to about 8 files, and I don't want that, just one .exe.

Thanks for your help...

Include An HTML File
I would like the user to be able to open an html file ( it's a help file created with Director) when clicking help in the menu.
How do I do this?

How To Include A C++ Library File
Hi all

Can anybody tell em how to use a c++ Library file in VB.

Thanks in advance
venky

How To Include Activex In Exe File
How to include activex component ocx,dll file in exe so that it is referenced in internal exe file. similarlly can vb runtime can be merged?

Please help me

VB6 Setup File.. Which Files Not To Include
Hey guys,

When compiling a program, which files shouldn't I add into my setup.exe to register? cause I know VB's Setup wizard adds a bunch of dll's that I think windows might already have.

Thanks!

Get FTP File List Include All Subfolder
Hi,

i am working on a project which need to display a list of FTP file (include subfolder) in a particular folder.

I am using Microsoft Internet Transfer Control in VB 6.0, execute command (e.g. Inet1.execute, "") to do all the 'GET' and 'PUT' function.
So I use Inet1.execute, "DIR" to list all folder and file, but this not include all file in subfolder.
So i try Inet1.execute, "DIR -R" which this command is work on FTP in Dos command but in VB, this is not working.

Can anybody help me to list all files within a period of date?

Thank!

asurasura

How To Include A Txt File I The Exe Standalone When Compiling
hi guys
basically i have a vb project that im working on
it uses 2 external text files fo reading and writing data into
using the following commands


Code:
Open App.Path & "C:Hi.txt" For Input As #1
Line Input #1, strline
Hi1 = strline
Line Input #1, strline
Hi2 = strline


now when i compile the exe, the txt files dont get included in the txt file.
so say i run the exe on another computer which i want to do, i need to transfer the hi.txt document and make sure its placed in the c drive. however i dont want to transfer the hi.txt file. i want it to be embedded somehow, so no one can alter the hi.txt file later on and cheat etc..

ps: the hi.txt file contains 2 integers on line 1 and 2.

is there anyway i could somehow do something to embed it into the exe itself? ( i have already tried using modules and that didnt work)

Copyright Đ 2005-08 www.BigResource.com, All rights reserved