Can I generate more than 1 Excel sheet when a command button is clicked?
For eg
I search for 2 names of audit dept and click print command button where records will be printed in Excel.
Again if I search for other 2 names and if I click print command button reports will not be printed.and gives error I have to close the program and load the program again.
If yes can you tell me how?
When I write a code when it executes or second Excel sheet it gives error
10 1969
can i generate more than 1 excel sheets when a command button is clicked
for eg
i search for 2 names of audit dept and click print command button where records will be printed in excel
again if i search for other 2 names and if i click print command button reports will not be printed.and gives error i have to close the program and load the program again
if yes can u tell me how.
hen i wrte a cde whenit eecutes or second exce sheet it gives error
--------------------------------------------------------------------------------
Can you explain detail?
VB Version?
you mean Report or excel sheet, then there versions?
Can you explain detail?
VB Version?
you mean Report or excel sheet, then there versions?
I am using VB6. I have coded in VB6 to generate an Excel sheet and put the data from Access to Excel sheet.
First time data will be placed in Excel sheet appropriately.
But again when I want to create it gives error Object variable or with block variable not set
please help.Very urgent.
Thanks
I think we'll need to see the code. It sounds as though you have created an Excel object in your program at startup or something, then released it (Set ... = Nothing) after using it, so then you can't use it again.
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
U will have to Release all the objects related to Excel, Otherwise u will get that error, Close and Set to Nothing xlApp object and xlwrkbook/xlsheet objects..
REgards
Veena
I am using VB6. I have coded in VB6 to generate an Excel sheet and put the data from Access to Excel sheet.
First time data will be placed in Excel sheet appropriately.
But again when I want to create it gives error Object variable or with block variable not set
please help.Very urgent.
Thanks
- Dim objexcel As excel.Application
-
Set objexcel = New excel.Application
-
objexcel.Visible = True
-
objexcel.SheetsInNewWorkbook = 4
-
objexcel.Workbooks.Add
-
-
-
Dim rsa As New ADODB.Recordset
-
rsa.Open "select count(*) from temp", conn, adOpenDynamic, adLockOptimistic
-
With rsa
-
Dim s As Integer
-
s = rsa.Fields(0)
-
Dim a As Integer
-
End With
-
rsa.Close
-
-
Dim rs As New ADODB.Recordset
-
rs.CursorLocation = adUseClient
-
rs.Open "select * from temp", conn, adOpenDynamic, adLockOptimistic
-
-
Dim strSQL As String
-
Dim n As Integer
-
Dim intcount2 As Integer
-
intcount2 = 0
-
intcount = 0
-
With rs
-
While rs.EOF = False
-
If rs.Fields(0) < 7 Then
-
ActiveSheet.Cells(intcount + 2, 1) = !Name
-
ActiveSheet.Cells(intcount + 3, 1) = !Des
-
ActiveSheet.Cells(intcount + 4, 1) = !comp
pls help this is th code
QVeen72 1,445
Recognized Expert Top Contributor
hI,
write this code at the end:
Set objexcel = Nothing
REgards
Veena
hI,
write this code at the end:
Set objexcel = Nothing
REgards
Veena
write objexcel=noting
but it dos not work
QVeen72 1,445
Recognized Expert Top Contributor
Hi,
If u already ebcountered that problem, u need to restart ur system and at the end it is "Set ObjExcel = Nothing"
REgards
Veena
Hi,
If u already ebcountered that problem, u need to restart ur system and at the end it is "Set ObjExcel = Nothing"
REgards
Veena
still it is not working
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Allison Bailey |
last post by:
Hi Folks,
I'm a brand new Python programmer, so please point me in the right
direction if this is not the best forum for this question....
I would like to open an existing MS Excel spreadsheet and extract
information from specific worksheets and cells.
I'm not really sure how to get started with this process.
I ran the COM Makepy utility from my PythonWin (IDE from ActiveSTate),
|
by: Iris |
last post by:
I have 8 text files (tab delimited) that I would like to import into an Excel workbook as 8 individual worksheets but I cannot find any example code on this subject. Can anyone help me please????
Thanks in advance.
Regards,
|
by: paul.chae |
last post by:
I have a table in Access with about 3000 records. There are ~60 unique
values in the ID field for the 3000 records. What I would like to do
is automatically generate multiple Excel worksheets within a single
workbook with these records. I would end up with around 500
worksheets, 1 for each unique ID value. I was thinking this could be
done if I have an exported flag column in the table, and I search for
the max (or min) on the ID...
|
by: dan_roman |
last post by:
Hi,
I developed a script with a nice interface in Tkinter that allows me to
edit some formulas and to generate an Excel worksheet with VBA macros
within it. The script runs perfectlly in Office 2000, but in Office
2003 crash at line: "wbc = workbook.VBProject.VBComponents.Add(1)"
Please help me :-(
the code of the module that crash is (only in Excel 2003, in 2000 not):
import os
|
by: Abdhul Saleem |
last post by:
Hi,
I am recieving error ActiveX component can't create object in the following
line in the asp page.
set ExcelApp = CreateObject("Excel.Application")
Previously this code was working fine.
Thanks in advance.
| |
by: LadyRed2 |
last post by:
Hello,
I am new to Excel and SQL server, so please be patient with me. I have written code with the help of others to update a table in a sql database from an excel form.
The connection code works as I have used it for a query before.
Here is the code
Private Sub CommandButton3_Click()
'to Update or Insert new into the form
|
by: dprjessie |
last post by:
Hello,
I am a Web programmer and I'm working on my first desktop application as a favor for a friend. I'm sure I have a stupid error here, but there is no error being thrown so I can't figure out what is wrong. I have code that reads an excel file and fills a datagridview and it works just fine. It is also supposed to fill a database though and that is not working. The executeNonQuery command is returning a 1 which as I understand, means it has...
|
by: sejal17 |
last post by:
hello
Can any one tell me how to read multiple worksheets from a single excel file.I have stored that excel in xml file.so i want to read that xml that has multiple worksheet.And i want to store that multiple worksheet data in different table.How can i do it.Below is my xml file.
<?xml version="1.0"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
...
|
by: stjones1 |
last post by:
My company has implementd Vista with IE7 and office 2007. We also use Sharepoint extensively for team sites and division portals. I am in Sharepoint consultation/support.
One user just moved a website from our old system to sharepoint, and now one of her links is broken. It is a simple ASP page with parameters that uses VB script to create an Excel object and load an Excel file into it (wb name, sheet name, and scroll number are the ASP...
|
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,...
|
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...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |