Well, if the section numbers aren't paged continuously (I.E. the sixth page is numbered as "section 2, page 1") then the regular print method does not work. In that case, you must specify p1s2 in the print area to get it to print that sixth page.
It would be super if we could use absolute page numbers to print pages from a word document. For example, we have two sections, each with 5 pages. Is there a way to have the user input "1-8" and get vb to print out the pages properly? I do NOT want to use the p1s2 stuff.
-Nick
I'm having trouble getting VBA to display the user names of individuals who have a workbook open for editing. I am using:
Sub GetUserName()
Dim users As Variant
Workbooks.Open ("T:\Book1.xls")
users = Workbooks("Book1.xls").UserStatus
If UBound(users, 1) > 0 Then...
None of the workbooks.open declarations will work here. Notify will send the workbook into the notification queue if indeed it is read-only, but will not bring up the dialog box, as I wanted.
I am opening a workbook using
workbooks.open("book.xls")
If it is already open, excel is opening it as read only. I would like for it to instead display the dialog box wherein the user can choose whether to open the book "read only" or "notify" or "cancel." How can that work?
-Nick
The easiest way to do that is turn on the macro recorder in Tools > Macros > Record. Then, go to File > Print, and set the printer to the Distiller (if it's already on the Distiller, set it to something else, then back to Distiller). Cancel the print job, hit "stop" on the macro recorder, then...
I have a macro running that opens some workbooks, selects some sheets, and sends out a print job to Adobe PDF, and makes a post-script file. I would like to append all the print jobs into a single post script file. Is this possible? How could that work?
Also, the macro is being rewritten so...
Thanks! Still not quite working yet . . .
Also, PHV's code doesn't quite work. I get an "Out of range" error. It apparently can't find the sheets as a split.
-Nick
I should probably rewrite what I have above, as it looks a little ambiguous:
I have a set of worksheets, and they are listed in a single cell. Like this:
A1 = "Sheet1, Sheet2, Sheet3"
And in VB, I want to select all of those sheets. I WAS using:
sheets(array("Sheet1", "Sheet2"...
I have a set of worksheets, all listed in a single cell. Like this:
"Sheet1, Sheet2, Sheet3 . . . "
And in VB, I want to select all of those sheets. I WAS using sheets(array("Sheet1", "Sheet2", . . . ).select
But now I want to use sheets(array(SheetNames)).select
Where SheetNames is the...
I need to be able to access cells in a closed workbook based on strings that contain the filename, sheet name, and cel range. I'd like to do this in a function, eg:
A1 = "C:\"
A2 = "Book1.xls"
A3 = "Sheet1"
A4 = "A1"
A5 = "GetClosedData(A1, A2, A3, A4)"
And return whatever was in that...
Well, I found the answer for anyone who struggles with this in the future:
If the dll is ActiveX, you simply set a reference, and treat the DLL as an object. For example, if you had a function MyFunction in a class Class1 in a dll MyFuncs,
(after referencing MyFuncs.dll)
Sub Test()
Dim...
Yes, the error message is always "Sub or Function not defined," at least witin Excel. I don't really know how to test from within VB6, the debugger is a little different. But the code I'm using is not at all complicated, it's about the most straightforward thing I could think of...
Rob - I think that may have been a part of it, which I have since fixed. I can now see the function in the object browser by only referencing the dll, and not declaring it. However, the function still won't work, saying it "has not been defined." So then I use the declare statement...
I am trying to write a DLL and have its functions accessible to Excel so that the code runs faster (right now, I have one module taking about 2 minutes to calculate). I wrote the following code in Visual Basic 6.0 Pro:
Public Function TimesFive(x As Double) As Double
TimesFive = x * 5...
I'm trying to access a function within an XLL. I cannot get it to register with through Tools > References.
I tried this code:
Declare Function EPPc Lib "Generic.xll" _
(x As Double, y As Double) As Double
But the function is still not being referenced. I have a similar...
Sorry Rob! I'm working on the same thing I was in the other thread - I assumed you would infer that - the program to output the Excel changes to a word doc. I wanted the full formula instead of row and column.
This is going to a word doc to have a record of changes made to a workbook, and I...
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.