I'm not sure, but you might be better off, just selecting A1 cell on you destination sheet and letting Excel deal with the expansion.
I have found that sometimes excel does not like it when I try to help, that its better doing the minimum.
Assuming only numeric bound columns
Assuming no multi select
try
dim lst1int as integer
dim lst2int as integer
if isnull(me.list1.value) or me.list1.value = "" or isnumeric(me.list1.value) = false then exit sub
ditto for list 2
lst1int = me.list1.value
lst2int = me.list2.value...
DoMenuItem is in affect deprecated, so for starters I would upgrade it to RunCommand which is meant to be its replacement, hopefully this might fix part of your problem or give you a more meaningful error message.
Part 1 is code I use.
Part 2 is some pertinent help file
Part 3 an example from help file as to how to change the code shown to do what you want
1.
Public Sub SendEmail(tostr As String, locstr As String, substr As String, bodystr As String)
'needs reference to Microsoft Excel 9.0 Object...
Sub Form_Open
DoCmd.Maximize
end sub
The Maximize method carries out the Maximize action in Visual Basic. For more information on how the action works, see the action topic.
Note This method cannot be applied to module windows in the Visual Basic Editor (VBE). For information about how to...
DoCmd.TransferDatabase acImport, "Microsoft Access", "H:\Access\MDB\Firefly Migrate.mdb", acTable, "JobComments", "JobComments", False
Look in TransferDatabase Method in help.
You'll need to build an interface where users can specify values to go above...
Most of the information you want is available to you if you are using outlook.
Just open an outlook application and use outlook VBA. Most textbooks give you eg's of automation from access. Just find a good one on outlook automation. If you want to more try finding a book on outlook vba, there...
This is a bit of a cheat but it works with Outlook, so I think it may work with power point, and you have to to do it, I haven't worked out a way to automate it.
Recreate the graphs on a form, copy and paste in design views will do most of this.
Open the graph form.
Select the the graph all...
TRANSFORM Min([CPID]) AS [MinOfCPID] SELECT [RD] FROM [BrandRespondDay2] GROUP BY [RD] PIVOT [BN];
I used the chart wizard to create this on a view I linked to the mdb. It works fine.
When I copy and paste the chart to an ADP bound to the SQL DB the link was in I keep being told that the...
Does any one know how to use a bound rich text box on a report.
I have addresses stored in a table with each line being a field, but some lines in some addresses don't have values, so I concatenate the fields putting chr(13) at the end of each line which does have a value.
When I try to show...
DoCmd.OpenReport "ErrorReport", acViewDesign
Reports!ErrorReport.Visible = False
Reports!ErrorReport.GroupLevel(0).ControlSource = "Field Name"
DoCmd.OpenReport "ErrorReport", acViewPreview
This is some code that dynamically changes the field the sorting on a...
Here are two functions to help with Single Quotes.
The problems are caused by the character with ascii 39, and there is another character that looks very like it, ascii 96 which causes no problems.
FixApostrophe replaces all the char 39 with char 96.
QorN is for preparing strings to be put in...
In all office applications, in the Visual Basic help, help file names are available in the lists on the left, but any help article about ADO or DAO do not appear when clicked.
EG Index Keywords
Enter "ADO"
Click RecordCount Property (ADO)
nothing happens, no new article appears.
The...
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.