- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI am trying to get some script together which will allow the data from a spreadsheet to be imported into a form. I will have a spreadsheet where the Office ID is in the first column, I will have a record open in notes which will have the Office in a field on the form. I want the system to look through each row of the spreadsheet and pull in the data if it matches the office ID on the open record. The code below is close but it forces me to separate the data for each office into its own tab. On the form I will have a series of fields in a table that the data will fall into. Below is just a basic layout where Import 1a..b..c would be the data that has matched this office ID from columns A,B,C in the spreadsheet. Hopefully what I am asking for amkes sense, appreciate any assistance.
Joe
Import1a Import 1b Import 1c
Import2a Import 2b Import 2c
Import3a Import 3b Import 3c
Import4a Import 4b Import 4c
Import5a Import 5b Import 5c
Sub Click(Source As Button)
Dim session As New NotesSession
Dim workspace As New NotesUIWorkspace
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim item As NotesItem
Dim Filename As String
Set db = session.CurrentDatabase
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim xlapp As Variant
Dim xlsheet As Variant
Dim x As Long
Filename = "C:\dlm_refresh\dlm_refres
' Excel.Workbooks.Open Filename '// Open the Excel file
Set xlapp = GetObject( Filename , "" )
shtname= doc.office_id(0) ' each sheet in excel is named with the agency 3-character id. I pull this from the doc to locate the correct sheet.
Set xlsheet = xlapp.WorkSheets( shtname )
doc.userid1 = Clng(xlsheet.range("C2").v
doc.userid2 = Clng(xlsheet.range("C3").v
doc.userid3 = Clng(xlsheet.range("C4").v
doc.userid4 = Clng(xlsheet.range("C5").v
doc.userid5 = Clng(xlsheet.range("C6").v
doc.asset1 = Clng(xlsheet.range("B2").v
doc.asset2 = Clng(xlsheet.range("B3").v
doc.asset3 = Clng(xlsheet.range("B4").v
doc.asset4 = Clng(xlsheet.range("B5").v
doc.asset5 = Clng(xlsheet.range("B6").v
Call doc.save(True,True)
Out:
Messagebox "Import done successfully."
Set xls = Nothing
Set sheet = Nothing
End Sub
This question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
900+ topic areas (and counting)
It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul.
We love the accolades. We love to be seen as the digital white knight who fixed the server, the computer, the email, and anything else that life depends on.
We love it so much, we sometimes make horrible decisions. Sometimes, we work "FOR FREE."
SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispersed nature of the blog posts that deal with some of these issues. This article will help SCCM OSD newbies with some of these issues.
For our deployments, we always install MDT 2008 on our SCCM server and select Configure ConfigMgr Integration from the MDT area on the start menu. This gives us:
Get full access to the help you need.
30-day free trial. Register in 60 seconds.
Bringing you the latest in technology
| Congressman Proposes Bill to Ban... | 11/28/12 |
| Death to Internet Anonymity: Google... | 11/27/12 |
| TEDx San Luis Obispo | 11/20/12 |
| SharePoint 2010 No-Code Solutions... | 11/19/12 |
| Keeping Your Passwords And Your Win... | 11/15/12 |
| Fun and Games with Hackers: How to... | 11/15/12 |
Listen while you work
Because of our active community of experts, on average new questions receive their first comment in under 30 minutes.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.
Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Business Accounts
Answer for Membership