All the machines generating the error except 1 had no printers installed. Once the printers were set up the problem was solved. The one machine with the printer already installed that was getting the error used to run the code fine. It's a laptop and it might have been rebooted without being...
Excel generates the same thing. I'm still looking into the printer drivers.
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = "This is a test"
.RightHeader = ""
.LeftFooter = ""
.CenterFooter =...
I have several macros which use the following code:
Private Sub FormatHeader()
Dim strTitle As String
Dim x As Integer
x = 1
strTitle = Trim(Cells(1, 1).Value)
Do While Mid(strTitle, x, 1) <> ")"
x = x + 1
Loop
strTitle =...
Thanks Mike your idea works great. I also found a site with info about modeless forms and progress bars at:
http://www.bmsltd.co.uk/Excel/Default.htm
Have a good one. Colin Chevrier
Colin_Chevrier@consulting.fujitsu.com
I have a database utility written by someone else that exports data to an Excel workbook. The user has requested a workbook that can be used to select the data from the exported workbook and format the data. I wanted a modeless form to display a message to the user while the report was being...
Anyone know how to create modeless forms in Excel 97? If not, I'm looking for a way to display a message to the user and not let them see the formatting that is happening on the sheets. I've turned ScreenUpdating off but when I select a new sheet it becomes visible. Colin Chevrier...
I have a transaction processor which moves information into a database. I've written an ActiveX exe which monitors which route is currently being processed. The transaction processor and the database front end both share an instance of the ActiveX exe. When the transaction processor is started...
I'm just getting into COM objects myself. You have:
Private Function IClient_getClients() As ADODB.Recordset
Shouldn't this be a Public function? Colin Chevrier
Colin_Chevrier@dmr.ca
The method I have used in the past goes somthing like this. First you have to reference the Microsoft Excel object in your project (I have v 8 on my machine). Next you have to declare your objects:
Dim xlApp as Excel.Application
Dim xlBook as Excel.Workbook
Dim xlSheet as Excel.Worksheet
Dim...
Thanks. Our app uses the Crystal Reports Data object so our situation is a little different. I did manage to solve the problem though. The 2D array was of type Variant so I changed it to a string array.
Colin Chevrier
Colin_Chevrier@dmr.ca
InputBox is a function supplied by VBA. The function returns a string value (the VB help files in Excel explain the function better than I can).
Sub Button5_Click()
Dim Msg As String, SomeString As String, Title As String, Help As String, MyString As String
Dim Style As Integer, Ctxt As...
Have you tried using an input box?
Dim SomeString
SomeString = InputBox("Enter Subject:")
Subject:=SomeString
Colin Chevrier
colin.chevrier@ca.jdsuniphase.com
You might be able to use GetActiveWindow and CloseHandle to kill the program but you will probably have all kinds of memory leaks.
Colin Chevrier
colin.chevrier@ca.jdsuniphase.com
This code works for me in VB5.
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = Excel.Application
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets.Add
//----------- Code goes here...
Try something like this (it works in Excel):
Dim x As Integer, y As Integer, RowNum As Integer
Dim SomeValue As Single
x = 2
y = 2
Do While Cells(x, 1).Value <> ""
RowNum = Cells(x, 1).Value
For y = 2 To 5
If Cells(x, y).Value...
I found this code during my wanderings on the net. It shows you how to change the font, change the position or create self closing message boxes.
Paste this code into a form:
Option Explicit
' demo project showing how to use the API to manipulate a messagebox
' by Bryan Stafford of New...
In the past I have had to force the cells to evaluate an expression sent from VB using something like:
Cells("A1").Value = "=$E$1+$E$4"
Range("A1").Calculate
Colin Chevrier
colin.chevrier@ca.jdsuniphase.com
VB 5 has a printer object. I've used it to print graphs from a custom control. <p>Colin Chevrier<br><a href=mailto:colin.chevrier@ca.jdsunph.com>colin.chevrier@ca.jdsunph.com</a><br><a href= > </a><br>
I haven't used C++ in over a year and I am having trouble getting information out of a text file. If anyone can steer me in the right direction I would be very grateful. Here's what I'm using:<br><br>#include <fstream.h><br>#include <iostream.h><br><br>void __fastcall...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.