Smartsheet api workspace sheet set - smartsheet-api-2.0

Thi is my first question.
I'm developing an exportation from our SQL based ERP to smartsheep.
We are developing in .NET (VB).
I'm creating / uploading sheet and creating data in row without problems.
My actual and almost last trouble is to be able to set a specified workspace...
Example.
I Upload a template XLSX file to smartsheet. I populate it with all the data i need to put inside, than (and here we are) i would like to set to the uploaded Sheet a specific workspace...
I'm using nuget smartsheet-csharp-sdk Version 2.126.0
Thank you for any reply.
This is more or less my code:
Dim smartsheet As SmartsheetClient = New SmartsheetBuilder().Build()
Dim sheet As Sheet = smartsheet.SheetResources.ImportXlsSheet(Dim XLSFILENAME as string, Nothing, 0, Nothing)
Than i have my build / upload rows code...
but no idea on how to set the workspace....

With the import ImportXlsSheet you can't set a destination, the sheet will be created at the root (home) or smartsheet.
You've to create the sheet, and by the response you should have access to the sheetId created.
With a second call to the API, move the sheet to the specific workspace. see also : https://smartsheet-platform.github.io/api-docs/?csharp#move-sheet

Related

Can I use PowerBI to access SharePoint files, and R to write those files to a local directory (without opening them)?

I have a couple of large .xlsb files in 2FA-protected SharePoint. They refresh periodically, and I'd like to automate the process of pulling them across to a local directory. I can do this in PowerBI already by polling the folder list, filtering to the folder/files that I want, importing them and using an R script to write that to an .rds (it doesn't need to be .rds - any compressed format would do). Here's the code:
let
#"~ Query ~"="",
//Address for the SP folder
SPAddress="https://....sharepoint.com/sites/...",
//Poll the content
Source15 = SharePoint.Files(SPAddress, [ApiVersion=15]),
//... some code to filter the content list down to the 2 .xlsb files I'm interested in - they're listed as nested 'binary' items under column 'Content' within table 'xlsbList'
//R export within an arbitrary 'add column' instruction
ExportRDS = Table.AddColumn(xlsbList, "Export", each R.Execute(
"saveRDS(dataset, file = ""C:/Users/current.user/Desktop/XLSBs/" & [Label] & ".rds"")",[dataset=Excel.Workbook([Content])[Data]{0}]))
However, the files are so large that my login times out before the refresh can complete. I've tried using R's file.copy command instead of saveRDS, to pick up the files as binaries (so PowerBI never has to import them):
R.Execute("file.copy(dataset, ""C:/Users/current.user/Desktop/XLSBs/""),[dataset=[Content]])
with dataset=[Content] instead of dataset=Excel.Workbook([Content])[Data]{0} (which gives me a different error, but in any event would result in the same runtime issues as before) but it tells me The Parameter 'dataset' isn't a Table. Is there a way to reference what PowerBI sees as binary objects, from within nested R (or Python) code so that I can copy them to a local directory without PowerBI importing them as data?
Unfortunately I don't have permissions to set the SharePoint site up for direct access from R/Python, or I'd leave PowerBI out entirely.
Thanks in advance for your help

How to use googledrive::drive_upload() without changing the Google ID of file?

When I upload a pptx file to Drive (or any file) I'd like to maintain the Google ID for the file, but every time I execute this function, a new Google ID is created even when overwrite=TRUE. This breaks the hyperlink that stakeholders were using to find the file in Drive. Is there a way to maintain the Google ID when overwriting during upload?
googldrive::drive_upload(
my_pres,
name = "My Presentation",
type = 'presentation', # converts pptx to Googleslides
overwrite = TRUE
)
According to the documentation googledrive::drive_upload() wraps the Files.create method of the Drive API. That is the wrong function to use for updating a file. The overwrite argument set as TRUE stands for:
"[...] Check for a pre-existing file at the filepath. If there is zero or one, move a pre-existing file to the trash[...]"
You should use googledrive::drive_update() which wraps the Files.update method of the Drive API. From the R docs, is described as:
"[...] Update an existing Drive file id with new content ("media" in Drive API-speak), new metadata, or both. To create a new file or update existing, depending on whether the Drive file already exists, see drive_put(). [...]"

Cannot place custom items on client hotbar/toolbar

Whenever I make a custom item, I am unable to drag it onto a hotbar. When I try to pick it up the icon turns to a question mark and will not stick to a hotkey.
For example, I made an exact copy of the Murloc Costume (id 33079) at id 50017 (which was a free slot on my DB). The original I can put on a hotbar. The custom one I cannot.
Here's a gif of the issue
Answer: if it's not in the client side DBC's, it will not work properly.
From ReynoldsCahoon on the AC Discord:
I just modified a DBC recently. I had to use a tool (I used Ladik's MPQ Editor) to extract the specific DBC I wanted to modify, and then I used WDBX to open the DBC and manipulate it. In WDBX you can output it in a variety of formats (like CSV or SQL) so you can modify the values any way you like, and then reimport (via CSV or SQL) the values back in.
I loosely followed the guide here: https://model-changing.net/tutorials/article/23-41-creating-your-first-mpq-patch/
I exported a DBC containing all of the Character Titles in the game. Erased all of them, and then imported a bunch of new values of my own choosing. Instead of importing that back into the MPQ I got it from, I created a new MPQ called patch-4.mpq that I placed in my client WotLK/Data/ directory, and then on the server, I placed the DBC file into the worldserver/data/dbc/ directory, replacing the original DBC.
I think this can optionally be overwritten in the database, by using the associated _dbc table to override values from the dbc files (someone correct me if this part is wrong).

Trigger excel solver from vb.net web app

Using vb.net, visual studio 2013 and excel 2010.
I have a web page and when a button is clicked values are passed from the page to excel ( a presaved formatted copy). I then want to run the solver add in (which I have also preconfigured). I have been searching for a while now and cannot find a way of doing this.
The below is the code I use to open the excel application
Dim xlApp As Excel.Application
Dim xlWorkbook As Excel.Workbook
Dim xlWorksheet As Excel.Worksheet
xlApp = New Excel.Application
xlApp.Visible = True
xlApp.DisplayAlerts = False
xlWorkbook = xlApp.Workbooks.Open("c:\temp\RTO.xlsx")
xlWorksheet = xlWorkbook.Sheets("Optimiser")
Another curious problem that may be related is when I open excel from the web page the solver addin is enabled in excels options but does not appear in the data ribbon tab. If I disable and enable it in the options it comes back.
UPDATE
I tried the following code
xlApp.Run("C:\Program Files\Microsoft Office\Office15\Library\SOLVER\solver.xlam!Auto_Open")
But it errors with the following
Additional information: Cannot run the macro 'C:\Program
Files\Microsoft Office\Office15\Library\SOLVER\solver.xlam!Auto_Open'.
The macro may not be available in this workbook or all macros may be
disabled.
Ok, so
1) a website that populates excel with data and then streams the excel to the client.
2) the client then fill out or manipulates stuff in the excel.
3) Then clicks a button to solve and perhaps submit the excel...(where you are stuck)
Step 3 could be accomplished with a small 'one click application ' aka 'clickonce', whereas the application is online and served from your site. You could take one cell of your excel and have it open IE and point to the installer, and even pass a parameters (be sure to allow params to pass in the app) as to where the excel was located. Then the app could interop with the excel and do its stuff, perhaps even deliver data back to the server.
After further research and thinking about my problem, I came up with the following.
I cannot find any help about triggering solver from within my vb.net code but you can trigger a macro.
First I added the following code which loaded solver.xlam into excel once it had launched.
xlWorkbook.VBProject.References.AddFromFile("C:\Program Files\Microsoft Office\Office15\Library\SOLVER\solver.xlam")
I then created a macro in excel to launch solver. Once done I added the following line of code into my web page. Runsolver is the name of the macro.
xlApp.Run("RunSolver")
Hope this helps someone else down the line

Excel component with charts for Classic ASP

I was using a company called ActiveXLS to save native XLS files with charts from Classic ASP but they seem to have closed down.
Can anyone recommend an alternative classic asp excel component I can use?
CSV or HTML (with XLS content type) export is not sufficient for what I need.
You can access the MS Excel DOM using Classic ASP. There are definite limitations of this approach for a web based environment but I have used it for low volumes.
Here's some sample code to illustrate:
Set oApp = Server.CreateObject("Excel.Application")
Set oBook = oApp.Workbooks.Add
Set oSheet = oBook.ActiveSheet
Set oRange = oApp.ActiveCell
' Create the header fields
oRange.Cells(1,1) = "Column 1"
oRange.Cells(1,2) = "Column 2"
oSheet.Range(oSheet.Cells(1,1), oSheet.Cells(i,j)).Select
oApp.Selection.Columns.AutoFit
oSheet.Cells(1,1).Select
oBook.SaveAs "filename.xls"
oBook.Close
oApp.Quit
Set oApp = Nothing
This does require Excel to be installed on the server that builds these files.

Resources