473,804 Members | 4,217 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with generating an excel document using VB

2 New Member
Hi


I'm trying to generate an excel document using visual basic? I can preview the report fine but the users want me to generate the report to mirror an excel sheet and export.

I was browsing the net but can't find anything relevant except for 'DoCmd.OutputTo acOutputReport, "name of report", acFormatRTF, , True
which generates the data in a word document.


If anyone has any ideas I'd appreciate it.


Thanks


Anita
Sep 13 '07 #1
2 1180
kadghar
1,295 Recognized Expert Top Contributor
Hi


I'm trying to generate an excel document using visual basic? I can preview the report fine but the users want me to generate the report to mirror an excel sheet and export.

I was browsing the net but can't find anything relevant except for 'DoCmd.OutputTo acOutputReport, "name of report", acFormatRTF, , True
which generates the data in a word document.


If anyone has any ideas I'd appreciate it.


Thanks


Anita
create an object with an excel application in it, then add to it anything you want

something like:

Expand|Select|Wrap|Line Numbers
  1. dim obj1 as object
  2. set obj1 = createobject("excel.application")
  3. obj1.visible=true
  4. obj1.workbooks.add
Then you can add to it anything you want:

like

Expand|Select|Wrap|Line Numbers
  1. obj1.cells(1,1).value = "hello world"
or if you have an array with 10 elements, you can do:

Expand|Select|Wrap|Line Numbers
  1. with obj1.workbooks(1).worksheets(1)
  2.     .range(.cells(1,1), .cells(1,10))= myarray
  3. end with
hope that helps
Sep 13 '07 #2
AnitaFitz
2 New Member
It's exactly what I needed and it's worked perfectly.


Thanks very much for the help


Anita
Sep 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
82466
by: Pawel | last post by:
Hello All I tried to embed Excel sheet into HTML page by following command: <iframe src="Tmp.XLS" width="100%" height="500"></iframe> and it works, showing Excel sheet inside the page, but there is no way I can save the Excel sheet after it has been change. The Excel menu is not active and the system is not asking whether I want to save the changes or not.
5
20237
by: Rimantas Žukaitis | last post by:
Hi, we are developing server side report generation application with .NET. The problem is, that we have to present same data in diferent formats (HTML, PDF, WORD, EXCEL). This has to be done using templates, wich are defined by user (with GUI frontend). The main problem is how to generate Word (or Excel) document with C#? Using COM automation seems to be very clumsy and resource consuming? Is there any way to generate Word document...
0
1448
by: Raghavendra | last post by:
hi, we r using forms authetication. problem :- i am using the below code to generate excel report but since we r using forms authetication.. after generating excel report the browser directs to login.apsx which is specified in web.config file. this code is in one file.aspx
4
3253
by: Lisa | last post by:
Hi - I'm able to open excel workbooks and word documents, but I can't seem to copy excel charts, named ranges, etc. to a word document. Anyone know of good reference material in this area? What little documentation I've been able to find focuses on using only one office app at a time. Thanks for your help
0
1769
by: Adrian Belen via .NET 247 | last post by:
hi, I have a problem when I try to open an excel document in a AxWebBrowser Component in VB.NET. The problem appear in this situation: Before to all the Excel application is opened from the user with some document xls. After that my application open an excel document (can be another document) using the component AxWebBrowser Then the first applications have problem when I try to modify the document.
2
7083
by: lxrocks | last post by:
Hi I have always downloaded table data to excel using a perl_cgi. The perl cgi will simpley print("Content-Type: application/vnd.ms-excel"); followed by the usual html table formatted data. However if I try the same with javascript it does not seem to work. ie document.write("Content-Type: application/vnd.ms-excel"); document.write("<html><table><thead>bla bla...</html>);
2
3158
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button then the calender gone actually i want if i click outside off the calender then it should me removed ..How kan i do this ... Pls inform me as early as possible .. I am waiting for ur quick replay ...Here i attached the source code .... <!DOCTYPE...
1
4442
vinci
by: vinci | last post by:
Please help me out... i only have two weeks to do it... here is my code: Dim ex As New Object Dim wb As Excel.Workbook Dim sheet As Excel.Worksheet
4
2578
by: stephen | last post by:
Hi all, I am working with Excel. I read an excel document using ExcelReader and lets say it has 10 columns. I have to read each record and based on a specified column peform some activites and then write the result at the end of the record (so will have 11 columns in total) At the same time, I am performing other calculations which has to be written at the end of the file (for eg. Total records, ..., ...). Currently, I am using...
0
9707
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9585
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10586
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10323
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6856
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5658
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4301
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3823
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.